Search code examples
pythonamazon-web-servicesbotoamazon-swf

How to get SWF activity information for a given workflow execution using boto


When looking at the SWF console on Amazon AWS, you can view closed workflow executions' histories. In the history, you can see all the activities that were called and their inputs and outputs.

I haven't been able to figure out how to access this activity information using boto 2. I am able to get the history of a workflow, but it resembles the "Events" tab of the SWF console and not the "Activities" tab. For example, it doesn't contain the output of any activities.

Here is the code I've used to get to where I am:

domain = boto.swf.layer2.Domain(name=swf_domain, 
                                aws_access_key_id=<id>, 
                                aws_secret_access_key=<secret>)

close_oldest_date = int((datetime.utcnow() - 
                         timedelta(days=LOOKBACK_DAYS)).timestamp())
execution = domain.executions(closed=True,
                              close_status='COMPLETED',
                              maximum_page_size=1,
                              close_oldest_date=close_oldest_date)[0]

print(execution.history())

Is there a way to access the completed activities' inputs, outputs, and other information using boto 2? Possibly using boto 3?


Solution

  • History contains complete information about activity execution.

    ActivityTaskScheduled contains input of an activity.

    ActivityTaskStarted contains identity of a worker (usually host:pid

    ActivityTaskCompleted contains activity output.

    ActivityTaskFailed contains failure information

    Consult API Referece to get full information about available events and their meaning.