Question 1 · choose 1
An AWS Step Functions state machine starts an AWS Glue job and then runs a Lambda function that validates the job's output. The Lambda function runs seconds after the job starts and finds no output. Job durations vary from 10 minutes to 2 hours. How should a data engineer fix the workflow?
- AUse the glue:startJobRun.sync resource for the Glue task
- BAdd a Wait state of 2 hours before the Lambda task
- CConvert the state machine to an Express workflow so the steps run in sequence
- DRaise the timeout of the validation Lambda function to its 15-minute maximum
Show the answer and why
AUse the glue:startJobRun.sync resource for the Glue task
Correct
With the Run a Job (.sync) pattern, Step Functions waits for the Glue job run to finish before it moves to the next state.
BAdd a Wait state of 2 hours before the Lambda task
Incorrect
A fixed wait wastes up to 2 hours on short runs and still breaks the day a run takes longer.
CConvert the state machine to an Express workflow so the steps run in sequence
Incorrect
Express workflows support only the Request Response pattern and run for at most five minutes, so they cannot wait for a 2-hour job.
DRaise the timeout of the validation Lambda function to its 15-minute maximum
Incorrect
A longer timeout does not delay the function's start, and 15 minutes is shorter than many of the job runs.
The default Request Response integration returns as soon as the job has started. The .sync suffix makes the Task state wait for the job to complete, however long it takes.
AWS documentation