Decisions

decisions are classes/encapsulations of decisions we send to SWF.

Decision Bases

Decision bases are base classes for various decision classes, essentially grouping and reusing common bits between actual decisions.

class botoflow.decisions.decision_bases.ActivityDecisionBase(decision_id)

Base for Activity decisions

Parameters
decision_id (str) -- Decision ID
class botoflow.decisions.decision_bases.DecisionBase

Every decision or decision base should inherit from this class

decision

Contains a dictionary of decision attributes

class botoflow.decisions.decision_bases.RecordMarkerDecisionBase(decision_id)

Record marker decision base

Parameters
decision_id (str) -- Decision ID
class botoflow.decisions.decision_bases.RequestCancelExternalWorkflowDecisionBase(workflow_id, run_id)

Base for requesting a cancellation of external workflow

Parameters
  • workflow_id (str) -- Workflow ID
  • run_id (str) -- Run ID
class botoflow.decisions.decision_bases.SignalExternalWorkflowExecutionDecisionBase(workflow_id, run_id, signal_name)

Signalling for external workflow

Parameters
  • workflow_id (str) -- Workflow ID
  • run_id (str) -- Run ID
  • signal_name (str) -- name of the signal to execute
class botoflow.decisions.decision_bases.StartChildWorkflowExecutionDecisionBase(workflow_type_name, workflow_type_version, workflow_id)

Starting child workflow base

Parameters
  • workflow_type_name (str) -- Workflow type name
  • workflow_type_version (str) -- version of the workflow
  • workflow_id (str) -- Workflow ID
class botoflow.decisions.decision_bases.TimerDecisionBase(decision_id)

Timer decisions base

Parameters
decision_id (str) -- Decision ID
class botoflow.decisions.decision_bases.WorkflowDecisionBase

Workflow decision base

Decision List

class botoflow.decisions.decision_list.DecisionList

DecisionList is just like a regular list with a few additional methods

delete_decision(decision_type, decision_id)

delete a decision

Returns
True if the decision was found and removed, False otherwise
Return type
bool
has_decision_type(*args)
to_swf()

Returns a list of decisions ready to be consumend by swf api

Decisions

class botoflow.decisions.decisions.CancelTimer(timer_id)

cancels a previously started timer and records a TimerCanceled event in the history.

class botoflow.decisions.decisions.CancelWorkflowExecution(details=None)

closes the workflow execution and records a WorkflowExecutionCanceled event in the history.

class botoflow.decisions.decisions.CompleteWorkflowExecution(result=None)

closes the workflow execution and records a WorkflowExecutionCompleted event in the history

class botoflow.decisions.decisions.ContinueAsNewWorkflowExecution(child_policy=None, execution_start_to_close_timeout=None, input=None, tag_list=None, task_list=None, task_priority=None, task_start_to_close_timeout=None, version=None)

closes the workflow execution and starts a new workflow execution of the same type using the same workflow id and a unique run Id. A WorkflowExecutionContinuedAsNew event is recorded in the history.

class botoflow.decisions.decisions.FailWorkflowExecution(reason=None, details=None)

closes the workflow execution and records a WorkflowExecutionFailed event in the history.

class botoflow.decisions.decisions.RecordMarker(marker_name, details=None)

records a MarkerRecorded event in the history. Markers can be used for adding custom information in the history for instance to let deciders know that they do not need to look at the history beyond the marker event.

class botoflow.decisions.decisions.RequestCancelActivityTask(activity_id)

attempts to cancel a previously scheduled activity task. If the activity task was scheduled but has not been assigned to a worker, then it will be canceled. If the activity task was already assigned to a worker, then the worker will be informed that cancellation has been requested in the response to RecordActivityTaskHeartbeat.

class botoflow.decisions.decisions.RequestCancelExternalWorkflowExecution(workflow_id, run_id, control=None)

requests that a request be made to cancel the specified external workflow execution and records a RequestCancelExternalWorkflowExecutionInitiated event in the history.

class botoflow.decisions.decisions.ScheduleActivityTask(activity_id, activity_type_name, activity_type_version, task_list=None, control=None, heartbeat_timeout=None, schedule_to_close_timeout=None, schedule_to_start_timeout=None, start_to_close_timeout=None, task_priority=None, input=None)

schedules an activity task

Parameters
  • activity_id (string) -- The activityId of the type of the activity being scheduled.
  • activity_type_name (string) -- The name of the type of the activity being scheduled.
  • activity_type_version (string) -- The version of the type of the activity being scheduled.
  • task_priority (string) -- If set, specifies the priority of the task
  • task_list (string) -- If set, specifies the name of the task list in which to schedule the activity task. If not specified, the defaultTaskList registered with the activity type will be used. Note: a task list for this activity task must be specified either as a default for the activity type or through this field. If neither this field is set nor a default task list was specified at registration time then a fault will be returned.
class botoflow.decisions.decisions.SignalExternalWorkflowExecution(workflow_id, run_id, signal_name, control=None, input=None)

requests a signal to be delivered to the specified external workflow execution and records a SignalExternalWorkflowExecutionInitiated event in the history.

class botoflow.decisions.decisions.StartChildWorkflowExecution(workflow_type, workflow_id, child_policy=None, control=None, execution_start_to_close_timeout=None, input=None, tag_list=None, task_list=None, task_start_to_close_timeout=None, task_priority=None)

requests that a child workflow execution be started and records a StartChildWorkflowExecutionInitiated event in the history. The child workflow execution is a separate workflow execution with its own history.

class botoflow.decisions.decisions.StartTimer(timer_id, start_to_fire_timeout, control=None)

starts a timer for this workflow execution and records a TimerStarted event in the history. This timer will fire after the specified delay and record a TimerFired event.