Decision, Workflow and Activity Context

Activity Context

class botoflow.context.activity_context.ActivityContext(worker, task)

ActivityContext is accessible from within activities via botoflow.get_context() and provides the ability to retrieve information about the workflow as well as access to the heartbeat() for heartbeating the execution of activity

Parameters
heartbeat(details=None)

Heartbeats current activity, raising CancellationError if cancel requested.

Ignore request by catching the exception, or let it raise to cancel.

Parameters
details (str) -- If specified, contains details about the progress of the task.
Raises
CancellationError -- if uncaught, will record this activity as cancelled in SWF history, and bubble up to the decider, where it will cancel the workflow.
workflow_execution
Returns
the information about current workflow that the activity is handling
Return type
botoflow.workflow_execution.WorkflowExecution

Decision Context

class botoflow.context.decision_context.DecisionContext(decider)

Decision context provides information about current workflow execution

workflow_execution
Returns
the current workflow execution information
Return type
botoflow.workflow_execution.WorkflowExecution

Start Workflow Context

class botoflow.context.start_workflow_context.StartWorkflowContext(worker)

Context provided when running within botoflow.workflow_starter.WorkflowStarter.

This gives you an opportunity to get access to the worker and workflow_execution. Generally though it's used for storing internal states.

workflow_starter
Return type
botoflow.workflow_starting.workflow_starter