Reputation: 173
I have a lambda function and a step function. I am trying to invoke my step function from my Lambda function. To do this, I did the following: (1) Provide my Lambda a role of 'AWSStepFunctionsFullAccess', (2) Made sure to pass in the correct input format for my step function (the only parameter it has is a $.Payload
)
My code to invoke my step function looks like:
client = boto3.client('stepfunctions')
transactionId = str(uuid.uuid1());
my_dict =... #This is the input I want to provide
input = {'Payload': {'input1': "HELLO"}} //Ideally I want to pass in a dict to my
response = client.start_execution(
stateMachineArn='arn:aws:states:us-west-2:ACCOUNTNumber:stateMachine:MyStateMachineTest',
name=transactionId,
input= json.dumps(input)
)
For some reason, I keep getting the following error in my logs: 2023-02-08T08:05:51.888Z 948af460-9ca2-4d42-aea5-6b26ba007ceb Task timed out after 3.07 seconds
I tried so many things but still can not figure out what I am doing wrong?
Upvotes: 0
Views: 1316
Reputation: 40
The reason this is happening is most probably because you have set a timeout to your lambda function (the one invoking the state machine). If you go to your Lambda function -> General Configuration -> Edit -> Timeout (increase this value)
. Try doing that and it should start working.
Upvotes: 1