You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "gocoolp (via GitHub)" <gi...@apache.org> on 2026/06/26 18:21:55 UTC

[I] [amazon] Add deferrable mode to DynamoDBValueSensor via DynamoDB Streams + SQS [airflow]

gocoolp opened a new issue, #69051:
URL: https://github.com/apache/airflow/issues/69051

   ### Description
   
   DynamoDBValueSensor currently only supports blocking poll mode — it calls table.get_item() on a fixed poke_interval and holds an Airflow worker slot for the entire wait duration. There is no deferrable mode, no DynamoDBValueTrigger, and no event-driven path.
   
   ### Use case/motivation
   
   A common Airflow pattern is using DynamoDB as a lightweight approval or job-state store — write metadata on submission, wait for a status field to flip to a target value (e.g. APPROVED, COMPLETED) before proceeding. The wait window can be hours (human approval workflows) or unpredictable (async external jobs).
   
     With blocking poll mode:
     - A worker slot is held for the entire wait duration
     - Approval-to-execution latency equals up to one full poke_interval even after the value changes
     - At scale, long-running sensors starve the worker pool
   
     Proposed: add a deferrable mode to DynamoDBValueSensor backed by a new DynamoDBValueTrigger, using DynamoDB Streams → SQS as the event source:
   
     1. DynamoDB Streams captures item changes (stream view: NEW_IMAGE)
     2. EventBridge Pipe or Lambda forwards records to an SQS queue
     3. DynamoDBValueTrigger consumes SQS asynchronously (following the existing SqsSensorTrigger pattern in triggers/sqs.py), filtering for records where the target attribute matches the expected value
     4. On match, fires a TriggerEvent and the sensor resumes
   
     Sensor interface (backwards compatible):
   
       DynamoDBValueSensor(
           ...,
           deferrable=True,
           stream_sqs_queue_url="https://sqs.us-east-1.amazonaws.com/...",
           waiter_delay=30,
       )
   
     When deferrable=False (default), existing polling behaviour is unchanged.
   
   ### Related issues
   
   - Existing SqsSensorTrigger: providers/amazon/src/airflow/providers/amazon/aws/triggers/sqs.py
     - Existing DynamoDBValueSensor: providers/amazon/src/airflow/providers/amazon/aws/sensors/dynamodb.py
     - Related CRUD hook PR: #69050 
   
   ### Are you willing to submit a PR?
   
   - [x] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's [Code of Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [amazon] Add deferrable mode to DynamoDBValueSensor via DynamoDB Streams + SQS [airflow]

Posted by "o-nikolas (via GitHub)" <gi...@apache.org>.
o-nikolas closed issue #69051: [amazon] Add deferrable mode to DynamoDBValueSensor via DynamoDB Streams + SQS
URL: https://github.com/apache/airflow/issues/69051


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [amazon] Add deferrable mode to DynamoDBValueSensor via DynamoDB Streams + SQS [airflow]

Posted by "abhijeets25012-tech (via GitHub)" <gi...@apache.org>.
abhijeets25012-tech commented on issue #69051:
URL: https://github.com/apache/airflow/issues/69051#issuecomment-4829868429

   i am working on it 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [amazon] Add deferrable mode to DynamoDBValueSensor via DynamoDB Streams + SQS [airflow]

Posted by "gocoolp (via GitHub)" <gi...@apache.org>.
gocoolp commented on issue #69051:
URL: https://github.com/apache/airflow/issues/69051#issuecomment-4832819094

   @abhijeets25012-tech - I have already started on it. Will be sharing a PR soon. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org