Run AWS Lambda execute async function
Allow Orchestra to run an AWS Lambda function asynchronously
Last updated
Allow Orchestra to run an AWS Lambda function asynchronously
Last updated
This job triggers an AWS Lambda function asynchronously with any given payload. To use this Integration Job, you must configure the function to be able to communicate back to Orchestra - see . If this is not configured correctly, the Task run will be stuck in RUNNING state, and will need to be cancelled manually.
Function name
Yes
String
None
Payload
No
JSON
JSON format
Region
No
String
AWS region
The AWS Lambda function is triggered with the following event by Orchestra:
If your function is written in Python, Orchestra recommends the orchestra-sdk
to ensure the Task can communicate efficiently with our platform. Remember to install the package before running the code:
My AWS Lambda function task is stuck in RUNNING in Orchestra?
It is likely that your AWS Lambda function has been unable to update the status of the task to Orchestra, and we have assumed it is still in RUNNING state. If this has happened, cancel the current task run, debug the issue, and then re-run the task.
My lambda function is not being started by Orchestra?
Check the AWS Lambda connection is valid and the permissions allow lambda:InvokeFunction
. Other AWS policies may be denying the role access
Ensure the function name and region are set correctly
I am using the orchestra-sdk
package, but my lambda function is not sending updates back to Orchestra?
Make sure the API key is set correctly
Use the configure_aws_lambda_event
method as close to the start of the handler function as possible. If not using this method, make sure the TASK_RUN_ID
and WEBHOOK_URL
are set correctly
You can enable debug logging in Python to see if there are any internal errors
Ensure your AWS Lambda Function is running in a VPC that allows outbound internet access
If you are not using the orchestra.run()
decorator, make sure the update_task
methods are being called correctly and the code reaches these methods as expected
My function sometimes succeeds and sometimes does not, and gets stuck in RUNNING state?
Make sure the AWS lambda function is not timing out or running out of memory - once this happens, the Task is unable to report back its status
I am expecting logs in the Orchestra platform, but they are not showing up?
Make sure your code is correctly logging to a file - for AWS Lambda functions, you can only write files to the /tmp/
directory
I am seeing logs for older task runs in my most recent task run?
AWS Lambda functions can re-use the same machine between invocations. Depending on your log setup, this means old log files still persist. Make sure to either delete log files once the function has finished, or create a new log file per invocation.
If your function is written in another language, please refer to documentation to see how your code can send updates back to Orchestra.
Make sure send_logs=True
is set in the Orchestra
class when initialising the object ()