vincbeck commented on code in PR #73935:
URL: https://github.com/apache/airflow/pull/73935#discussion_r4144680175


##########
providers/amazon/src/airflow/providers/amazon/aws/operators/mwaa_serverless.py:
##########
@@ -80,11 +103,46 @@ def execute(self, context: Context) -> str:
                 "WorkflowArn": self.workflow_arn,
                 "OverrideParameters": self.override_parameters,
                 "WorkflowVersion": self.workflow_version,
+                "ClientToken": self.client_token,
             }
         )
         response = self.hook.conn.start_workflow_run(**kwargs)
         run_id = response["RunId"]
         self.log.info("Started workflow run %s (status: %s)", run_id, 
response.get("Status"))
+
+        if self.deferrable:
+            self.log.info("Deferring until workflow run %s completes", run_id)
+            self.defer(
+                trigger=MwaaServerlessWorkflowRunCompletedTrigger(
+                    workflow_arn=self.workflow_arn,
+                    run_id=run_id,
+                    waiter_delay=self.waiter_delay,
+                    waiter_max_attempts=self.waiter_max_attempts,
+                    aws_conn_id=self.aws_conn_id,
+                    region_name=self.region_name,
+                    verify=self.verify,
+                    botocore_config=self.botocore_config,
+                ),
+                method_name="execute_complete",
+            )
+        elif self.wait_for_completion:

Review Comment:
   @ramitkataria tagging you here since you are going to work on `deferrable` 
and `wait_for_completion` across the amazon provider package. I just want to 
make sure this logic is the one we want to forward with



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to