AWS Step Functions
To configure your step functions to integrate with Lumigo, perform the following steps:
- Add an environment variable LUMIGO_STEP_FUNCTION to Lambda functions that are triggered by your step function’s state machine, and set its value to TRUE:
Key | Value |
---|---|
LUMIGO_STEP_FUNCTION | TRUE |
- If you are using custom Parameters, update the function's input to include the following line:
"_lumigo.$": "$.['_lumigo', 'null']"
Modified Function Return Value
A JSON attribute - "_lumigo" - with a unique identifier will be automatically added to the return value of your handler function. This attribute will resemble the following:
"_lumigo": { "step_function_uid": "your-step-function-id" }
Examples
Direct trigger
"States": {
"state1": {
"Type": "Task",
"Resource": "arn:aws:lambda:us-west-2:ACCOUNT:function:FUNCTION_NAME",
"Parameters": {
"size.$": "$.product.details.size",
"exists.$": "$.product.availability",
"_lumigo.$": "$.['_lumigo', 'null']"
},
"Next": "state2"
},
"state2": {
"Type": "pass",
"End": true
}
}
Using the lambda:invoke API:
"States":{
"state1":{
"Type":"Task",
"Resource":"arn:aws:states:::lambda:invoke.waitForTaskToken",
"Parameters":{
"FunctionName":"arn:aws:lambda:us-west-2:ACCOUNT:function:FUNCTION_NAME",
"Payload":{
"size.$": "$.product.details.size",
"_lumigo.$": "$.['_lumigo', 'null']"
},
"Qualifier":"prod-v1"
},
"End":true
}
}
Updated over 1 year ago