Run AWS Lambda execute async function

Allow Orchestra to run an AWS Lambda function asynchronously

Description

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 Self hosted Tasks. If this is not configured correctly, the Task run will be stuck in RUNNING state, and will need to be cancelled manually.

Parameters and setup

Lambda configuration

The AWS Lambda function is triggered with the following event by Orchestra:

{
  "orchestra_task_run_id": "<ORCHESTRA_TASK_RUN_ID>",
  "orchestra_webhook_url": "<ORCHESTRA_WEBHOOK_URL>",
  "task_run_data": <TASK_PARAMETERS_PAYLOAD> // see above table
}

If your function is written in Python, Orchestra recommends the orchestra-sdk PyPi package to ensure the Task can communicate efficiently with our platform. Remember to install the package before running the code:

from orchestra_sdk.orchestra import OrchestraSDK

orchestra = OrchestraSDK(api_key="<ORCHESTRA_API_KEY>")

def handler(event, context):
    orchestra.configure_aws_lambda_event(event)
    # Your code here
    
# The decorator will automatically send task updates.
@orchestra.run()
def my_function(arg1, arg2=1):
    print("Running complex process")

If your function is written in another language, please refer to Self hosted Tasks documentation to see how your code can send updates back to Orchestra.

Troubleshooting

Last updated