1. Event trigger
An EventBridge rule detects creation of the S3 object matching */intents-final/intents.md, then starts the state machine with the intent references.
In this SDLC solution, Step Functions coordinates the generation of requirements, software design and user stories. The workflow sequences agents, waits for their callback results and makes progress visible.
The workflow follows an explicit sequence and updates its state at each transition, from initialisation through success or failure.
An EventBridge rule detects creation of the S3 object matching */intents-final/intents.md, then starts the state machine with the intent references.
The workflow creates the job in DynamoDB and sets each step to PENDING. A step changes to RUNNING when its processing begins.
Agents generate requirements (requirements), software design (swDesign) and then user stories (userStories), in sequence.
After each callback, Step Functions marks the step DONE and continues. An error sets the step and job to FAILED, with details retained.
The waitForTaskToken callback pattern lets the workflow wait while an agent works, without keeping the invocation Lambda active until generation finishes.
For each document, Step Functions provides a task token to the invocation Lambda. It passes the deliverable type, input S3 keys and token to the generate-agent, which then starts processing in the background.
The Step Functions execution waits for the callback. While processing, the agent periodically renews the wait with a heartbeat; the Terraform definition specifies a 120-second heartbeat and a maximum task duration of 3,600 seconds.
When the document is ready, the agent writes it to S3 and calls SendTaskSuccess. If a problem occurs, it calls SendTaskFailure; the workflow follows its failure path and retains the error status for inspection.
Job tracking is separate from document storage. This lets the application show progress without reading execution logs or passing documents through workflow messages.
The table stores the overall status, current step, timestamps, per-deliverable states, generated file references and error information.
The intent-agent finds jobs associated with the intent key through the intentKey-index secondary index, then returns the results to the interface.
After submission, the frontend polls JOB_STATUS every seven seconds. The display updates, and polling stops when the job is DONE or FAILED.
The workflow definition also provides targeted retries for certain invocation and heartbeat errors. Execution details remain available in Step Functions history, and errors are recorded in the job data.