Skip to main content

AWS Step Functions ⇄ Pulse

Intermediate ⏱ 15 min aws · asl · lambda task · 🧪 state machine validated live

Step Functions owns the durable state machine; Pulse is the streaming step it calls. ASL is declarative and doesn't do HTTP itself — a Task state invokes a Lambda, and the Lambda calls Pulse. Repo example: examples/stepfunctions-pulse-bridge/.

ScoreViaPulse (Task: lambda:invoke, Retry ×3 backoff 2.0) → Decide (Choice on $.verdict.high_value) → Escalate | AutoApprove

The Lambda (lambda_function.py) does the universal two calls: POST .../x/order-scoring/in, GET .../events/order-scoring.score.out.

Run it locally — the whole state machine, not just the Lambda

pulse server start --dev
mkdir app && cp pulse.yaml app/ && (cd app && pulse deploy .)
pip install requests
PULSE_URL=http://localhost:9090 python run_local.py

run_local.py is a tiny ASL interpreter that executes the same statemachine.asl.json you would deploy to AWS — the Task (running the real handler), ResultSelector/ResultPath, the Choice, the Pass states. Validated output:

amount= 2500 -> high_value=True decision=escalate
amount= 300 -> high_value=False decision=auto-approve

Deploying to real AWS

statemachine.asl.json is deploy-ready: create the Lambda from lambda_function.py (set PULSE_URL/PULSE_TOKEN in its environment), point the Task's Resource at its ARN, create the state machine. The 🧪 status means exactly this: the definition runs validated against live Pulse; the AWS-hosted run needs your AWS account.

Next