Options Contexts

class botoflow.options.activity_options(task_list=<class 'botoflow.options._NOT_SET'>, version=<class 'botoflow.options._NOT_SET'>, name=<class 'botoflow.options._NOT_SET'>, heartbeat_timeout=<class 'botoflow.options._NOT_SET'>, schedule_to_start_timeout=<class 'botoflow.options._NOT_SET'>, start_to_close_timeout=<class 'botoflow.options._NOT_SET'>, schedule_to_close_timeout=<class 'botoflow.options._NOT_SET'>, task_priority=<class 'botoflow.options._NOT_SET'>)

This context manager helps override activity task options.

Please see botoflow.decorators.activity() for available keyword arguments and their descriptions.

Example usage:

class ExampleWorkflow(WorkflowDefinition):

    @execute(version='1.0', execution_start_to_close_timeout=60)
    def execute(self, arg1, arg2):

        # override the start_to_close_timeout in all activities in this
        # context
        with activity_options(start_to_close_timeout=2*MINUTES):
            arg_sum = yield BunchOfActivities.sum(arg1, arg2)
        return_(arg_sum)

Override activity task options

Parameters
  • task_list (str) -- Specifies the task list to be registered with Amazon SWF for this activity type.
  • version (str) -- Specifies the version of the activity type.
  • name (str) -- Specifies the name of the activity type.
  • heartbeat_timeout (int) -- Specifies the heartbeat timeout override. Activity workers must provide heartbeat within this duration; otherwise, the task will be timed out. Set to None by default, which is a special value that indicates this timeout should be disabled. See Amazon SWF API reference for more details.
  • schedule_to_start_timeout (int) -- Specifies the schedule to start timeout for this activity type. This is the maximum time a task of this activity type is allowed to wait before it is assigned to a worker.
  • start_to_close_timeout (int) -- Specifies the start to close timeout for this activity type. This timeout determines the maximum time a worker can take to process an activity task of this type.
  • schedule_to_close_timeout (int) -- Specifies the schedule to close timeout for this activity type. This timeout determines the total duration that the task can stay in open state.
  • task_priority (int) -- Specifies the priority of the task. If not specified uses the default task priority. higher numbers indicate higher priority.
class botoflow.options.workflow_options(task_list=<class 'botoflow.options._NOT_SET'>, workflow_id=<class 'botoflow.options._NOT_SET'>, version=<class 'botoflow.options._NOT_SET'>, execution_start_to_close_timeout=<class 'botoflow.options._NOT_SET'>, task_start_to_close_timeout=<class 'botoflow.options._NOT_SET'>, child_policy=<class 'botoflow.options._NOT_SET'>, name=<class 'botoflow.options._NOT_SET'>, data_converter=<class 'botoflow.options._NOT_SET'>, tag_list=<class 'botoflow.options._NOT_SET'>, task_priority=<class 'botoflow.options._NOT_SET'>)

Using this context manager you can override workflow execution options.

Example:

class MasterWorkflow(WorkflowDefinition):

    @execute(version='1.0', execution_start_to_close_timeout=1*MINUTES)
    def execute(self, arg1, arg2):

        # override the default execution_start_to_close_timeout when
        # starting this child workflow
        with workflow_options(execution_start_to_close_timeout=4*MINUTES):
            arg_sum = yield ChildWorkflow.execute(arg1, arg2)
        return_(arg_sum)

Override workflow execution options

Parameters
  • task_list (str) -- The task list for the decision tasks for executions of this workflow type.
  • workflow_id (str) -- Set explicit workflow ID
  • version (str) -- workflow version
  • execution_start_to_close_timeout (int) -- This specifies the total time a workflow execution of this type may take to complete.
  • task_start_to_close_timeout (int) -- This specifies the time a single decision task for a workflow execution of this type may take to complete.
  • child_policy (str) -- Specifies the policy to use for the child workflows if an execution of this type is terminated.
  • data_converter (awsflow.data_converter.abstract_data_converter.AbstractDataConverter) -- Specifies the type of the DataConverter to use for serializing/deserializing data when sending requests to and receiving results from workflow executions of this workflow type.
  • tag_list (list) -- List of tags to associate with the workflow.
  • task_priority (int) -- Specifies the priority of the task. If not specified uses the default task priority. higher numbers indicate higher priority.