from garcon import task import time @task.decorate(timeout=60) def print_hello_task( activity, activity_name, task_name, workflow_id, prior_message, sleep): """ Print current activity task and prior activity task Args: activity (ActivityWorker): Garcon ActivityWorker executing the task. activity_name (str): Name identifying the activity executing the task. task_name (str): Name identifying the task. workflow_id (str): SWF workflowid executing the task. prior_message (str): Message on the prior activity task sleep (str): (optional) Sleep before starting task. Returns: context (str) : Pass current activity task """ if sleep is not None: time.sleep(sleep) message = 'I am {workflow_id}, {activity_name}, {task_name}'.format( workflow_id=workflow_id, activity_name=activity_name, task_name=task_name) print(message) print('- ' + prior_message) context = {'message': message, ' foobar': 'hi'} return context