Exemplo n.º 1
0
def register_workflow_type(
    domain, name, version, description=None,
    default_task_start_to_close_timeout=None,
    default_execution_start_to_close_timeout=None, default_task_list=None,
    default_task_priority=None, default_child_policy="TERMINATE",
    default_lambda_role=None):
    """Register a workflow type.

    Registers a new workflow type and its configuration settings in the
    specified domain.

    The retention period for the workflow history is set by the RegisterDomain
    action.

    Warning
    If the type already exists, then a TypeAlreadyExists fault is returned. You
    cannot change the configuration settings of a workflow type once it is
    registered and it must be registered as a new version.

    http://boto3.readthedocs.org/en/latest/reference/services/swf.html#SWF.Client.register_workflow_type

    domain (string) -- [REQUIRED]
    The name of the domain in which to register the workflow type.

    name (string) -- [REQUIRED]
    The name of the workflow type.

    version (string) -- [REQUIRED]
    The version of the workflow type.

    description (string) --
    Textual description of the workflow type.

    default_task_start_to_close_timeout (string) --
    If set, specifies the default maximum duration of decision tasks for this
    workflow type. This default can be overridden when starting a workflow
    execution using the StartWorkflowExecution action or the
    StartChildWorkflowExecution decision.

    default_execution_start_to_close_timeout (string) --
    If set, specifies the default maximum duration for executions of this
    workflow type. You can override this default when starting an execution
    through the StartWorkflowExecution action or StartChildWorkflowExecution
    decision.

    default_task_list (dict) --
    If set, specifies the default task list to use for scheduling decision tasks
    for executions of this workflow type. This default is used only if a task
    list is not provided when starting the execution through the
    StartWorkflowExecution action or StartChildWorkflowExecution decision.

        name (string) -- [REQUIRED]
        The name of the task list.

    default_task_priority (int) --
    The default task priority to assign to the workflow type. If not assigned,
    then "0" will be used. Valid values are integers that range from Java's
    Integer.MIN_VALUE (-2147483648) to Integer.MAX_VALUE (2147483647). Higher
    numbers indicate higher priority.

    default_child_policy (string) --
    If set, specifies the default policy to use for the child workflow
    executions when a workflow execution of this type is terminated, by calling
    the TerminateWorkflowExecution action explicitly or due to an expired
    timeout. This default can be overridden when starting a workflow execution
    using the StartWorkflowExecution action or the StartChildWorkflowExecution
    decision.

        The supported child policies are:
        TERMINATE: the child executions will be terminated.
        REQUEST_CANCEL: a request to cancel will be attempted for each child
                        execution by recording a WorkflowExecutionCancelRequested
                        event in its history.  It is up to the decider to take
                        appropriate actions when it receives an execution history
                        with this event.
        ABANDON: no action will be taken. The child executions will continue to run.

    default_lambda_role (string) --
    The ARN of the default IAM role to use when a workflow execution of this
    type invokes AWS Lambda functions.

    return None
    """
    kwargs = {}

    for aws_prop, value, conversion in (
        ('description', description, None),
        ('defaultTaskStartToCloseTimeout', default_task_start_to_close_timeout,
         None),
        ('defaultExecutionStartToCloseTimeout',
         default_execution_start_to_close_timeout, None),
        ('defaultTaskList', default_task_list, None),
        ('defaultTaskPriority', default_task_priority, str),
        ('defaultChildPolicy', default_child_policy, None),
        ('defaultLambdaRole', default_lambda_role, None)):

        kwargs = check_and_add_kwargs(aws_prop, value, conversion, kwargs)

    result = make_request(
        SWF.register_workflow_type,
        domain=domain,
        name=name,
        version=version,
        **kwargs)

    if result.success:
        return

    if result.result.code == WORKFLOW_TYPE_ALREADY_EXISTS:
        raise WorkflowTypeAlreadyExistsError("Workflow type already exists.")

    raise RegisterWorkflowTypeError(result.result.message)
Exemplo n.º 2
0
def register_activity_type(
    domain, name, version, description=None,
    default_task_start_to_close_timeout=None,
    default_task_heartbeat_timeout=None, default_task_list=None,
    default_task_priority=None, default_task_schedule_to_start_timeout=None,
    default_task_schedule_to_close_timeout=None):
    """Registers a new activity type along with its configuration settings in
    the specified domain.

    WARNING
    A TypeAlreadyExists fault is returned if the type already exists in the
    domain. You cannot change any configuration settings of the type after its
    registration, and it must be registered as a new version.

    http://boto3.readthedocs.org/en/latest/reference/services/swf.html#SWF.Client.register_activity_type

    domain (string) -- [REQUIRED]
    The name of the domain in which this activity is to be registered.

    name (string) -- [REQUIRED]
    The name of the activity type within the domain.

    version (string) -- [REQUIRED]
    The version of the activity type.

    description (string) --
    A textual description of the activity type.

    default_task_start_to_close_timeout (string) --
    If set, specifies the default maximum duration that a worker can take to
    process tasks of this activity type. This default can be overridden when
    scheduling an activity task using the ScheduleActivityTask decision.

    default_task_heartbeat_timeout (string) --
    If set, specifies the default maximum time before which a worker processing
    a task of this type must report progress by calling
    RecordActivityTaskHeartbeat. If the timeout is exceeded, the activity task
    is automatically timed out. This default can be overridden when scheduling
    an activity task using the ScheduleActivityTask decision. If the activity
    worker subsequently attempts to record a heartbeat or returns a result, the
    activity worker receives an UnknownResource fault. In this case, Amazon SWF
    no longer considers the activity task to be valid; the activity worker
    should clean up the activity task.

        The duration is specified in seconds; an integer greater than or equal
        to 0. The value "NONE" can be used to specify unlimited duration.

    default_task_list (dict) --
    If set, specifies the default task list to use for scheduling tasks of this
    activity type. This default task list is used if a task list is not provided
    when a task is scheduled through the ScheduleActivityTask decision.

        name (string) -- [REQUIRED]
        The name of the task list.

    default_task_priority (int) --
    The default task priority to assign to the activity type. If not assigned,
    then "0" will be used. Valid values are integers that range from Java's
    Integer.MIN_VALUE (-2147483648) to Integer.MAX_VALUE (2147483647). Higher
    numbers indicate higher priority.

    default_task_schedule_to_start_timeout (string) --
    If set, specifies the default maximum duration that a task of this activity
    type can wait before being assigned to a worker. This default can be
    overridden when scheduling an activity task using the ScheduleActivityTask
    decision.

    default_task_schedule_to_close_timeout (string) --
    If set, specifies the default maximum duration for a task of this activity
    type. This default can be overridden when scheduling an activity task using
    the ScheduleActivityTask decision.

    return None
    """
    kwargs = {}

    for aws_prop, value, conversion in (
        ('description', description, None),
        ('defaultTaskStartToCloseTimeout', default_task_start_to_close_timeout,
         None),
        ('defaultTaskHeartbeatTimeout', default_task_heartbeat_timeout, None),
        ('defaultTaskList', default_task_list, None),
        ('defaultTaskPriority', default_task_priority, str),
        ('defaultTaskScheduleToStartTimeout',
         default_task_schedule_to_start_timeout, None),
        ('defaultTaskScheduleToCloseTimeout',
         default_task_schedule_to_close_timeout, None)):

        kwargs = check_and_add_kwargs(aws_prop, value, conversion, kwargs)

    result = make_request(
        SWF.register_activity_type,
        domain=domain,
        name=name,
        version=version,
        **kwargs)

    if result.success:
        return

    if result.result.code == ACITVITY_TYPE_ALREADY_EXISTS:
        raise ActivityTypeAlreadyExistsError("Workflow type already exists.")

    raise RegisterActivityError(result.result.message)
Exemplo n.º 3
0
def register_workflow_type(domain,
                           name,
                           version,
                           description=None,
                           default_task_start_to_close_timeout=None,
                           default_execution_start_to_close_timeout=None,
                           default_task_list=None,
                           default_task_priority=None,
                           default_child_policy="TERMINATE",
                           default_lambda_role=None):
    """Register a workflow type.

    Registers a new workflow type and its configuration settings in the
    specified domain.

    The retention period for the workflow history is set by the RegisterDomain
    action.

    Warning
    If the type already exists, then a TypeAlreadyExists fault is returned. You
    cannot change the configuration settings of a workflow type once it is
    registered and it must be registered as a new version.

    http://boto3.readthedocs.org/en/latest/reference/services/swf.html#SWF.Client.register_workflow_type

    domain (string) -- [REQUIRED]
    The name of the domain in which to register the workflow type.

    name (string) -- [REQUIRED]
    The name of the workflow type.

    version (string) -- [REQUIRED]
    The version of the workflow type.

    description (string) --
    Textual description of the workflow type.

    default_task_start_to_close_timeout (string) --
    If set, specifies the default maximum duration of decision tasks for this
    workflow type. This default can be overridden when starting a workflow
    execution using the StartWorkflowExecution action or the
    StartChildWorkflowExecution decision.

    default_execution_start_to_close_timeout (string) --
    If set, specifies the default maximum duration for executions of this
    workflow type. You can override this default when starting an execution
    through the StartWorkflowExecution action or StartChildWorkflowExecution
    decision.

    default_task_list (dict) --
    If set, specifies the default task list to use for scheduling decision tasks
    for executions of this workflow type. This default is used only if a task
    list is not provided when starting the execution through the
    StartWorkflowExecution action or StartChildWorkflowExecution decision.

        name (string) -- [REQUIRED]
        The name of the task list.

    default_task_priority (int) --
    The default task priority to assign to the workflow type. If not assigned,
    then "0" will be used. Valid values are integers that range from Java's
    Integer.MIN_VALUE (-2147483648) to Integer.MAX_VALUE (2147483647). Higher
    numbers indicate higher priority.

    default_child_policy (string) --
    If set, specifies the default policy to use for the child workflow
    executions when a workflow execution of this type is terminated, by calling
    the TerminateWorkflowExecution action explicitly or due to an expired
    timeout. This default can be overridden when starting a workflow execution
    using the StartWorkflowExecution action or the StartChildWorkflowExecution
    decision.

        The supported child policies are:
        TERMINATE: the child executions will be terminated.
        REQUEST_CANCEL: a request to cancel will be attempted for each child
                        execution by recording a WorkflowExecutionCancelRequested
                        event in its history.  It is up to the decider to take
                        appropriate actions when it receives an execution history
                        with this event.
        ABANDON: no action will be taken. The child executions will continue to run.

    default_lambda_role (string) --
    The ARN of the default IAM role to use when a workflow execution of this
    type invokes AWS Lambda functions.

    return None
    """
    kwargs = {}

    for aws_prop, value, conversion in (
        ('description', description, None),
        ('defaultTaskStartToCloseTimeout', default_task_start_to_close_timeout,
         None), ('defaultExecutionStartToCloseTimeout',
                 default_execution_start_to_close_timeout,
                 None), ('defaultTaskList', default_task_list, None),
        ('defaultTaskPriority', default_task_priority,
         str), ('defaultChildPolicy', default_child_policy,
                None), ('defaultLambdaRole', default_lambda_role, None)):

        kwargs = check_and_add_kwargs(aws_prop, value, conversion, kwargs)

    result = make_request(SWF.register_workflow_type,
                          domain=domain,
                          name=name,
                          version=version,
                          **kwargs)

    if result.success:
        return

    if result.result.code == WORKFLOW_TYPE_ALREADY_EXISTS:
        raise WorkflowTypeAlreadyExistsError("Workflow type already exists.")

    raise RegisterWorkflowTypeError(result.result.message)
Exemplo n.º 4
0
def start_workflow_execution(domain, workflow_id, workflow_type_name,
                             workflow_type_version, task_list=None,
                             task_priority=None, _input=None,
                             execution_start_to_close_timeout=None,
                             tag_list=None, child_policy=None,
                             task_start_to_close_timeout=None,
                             lambda_role=None):
    """Starts an execution of the workflow type in the specified domain using
    the provided workflowId and input data.

    This action returns the newly started workflow execution.

    http://boto3.readthedocs.org/en/latest/reference/services/swf.html#SWF.Client.start_workflow_execution

    domain (string) -- [REQUIRED]
    The name of the domain in which the workflow execution is created.

    workflow_id (string) -- [REQUIRED]
    The user defined identifier associated with the workflow execution. You can
    use this to associate a custom identifier with the workflow execution. You
    may specify the same identifier if a workflow execution is logically a
    restart of a previous execution. You cannot have two open workflow
    executions with the same workflowId at the same time.

    workflow_type (dict) -- [REQUIRED]
    The type of the workflow to start.

        ITEMS:
        name (string) -- [REQUIRED]
        Required. The name of the workflow type.

        version (string) -- [REQUIRED]
        Required. The version of the workflow type.

    task_list (dict) --
    The task list to use for the decision tasks generated for this workflow
    execution. This overrides the defaultTaskList specified when registering the
    workflow type.

        ITEMS:
        name (string) -- [REQUIRED]
        The name of the task list.

    task_priority (int) --
    The task priority to use for this workflow execution. This will override any
    default priority that was assigned when the workflow type was registered. If
    not set, then the default task priority for the workflow type will be used.
    Valid values are integers that range from Java's Integer.MIN_VALUE
    (-2147483648) to Integer.MAX_VALUE (2147483647). Higher numbers indicate
    higher priority.

    _input (string) --
    The input for the workflow execution. This is a free form string which
    should be meaningful to the workflow you are starting. This input is made
    available to the new workflow execution in the WorkflowExecutionStarted
    history event.

    execution_start_to_close_timeout (string) --
    The total duration for this workflow execution. This overrides the
    defaultExecutionStartToCloseTimeout specified when registering the workflow
    type.

    tag_list (list) --
    The list of tags to associate with the workflow execution. You can specify a
    maximum of 5 tags. You can list workflow executions with a specific tag by
    calling ListOpenWorkflowExecutions or ListClosedWorkflowExecutions and
    specifying a TagFilter .

    task_start_to_close_timeout (string) --
    Specifies the maximum duration of decision tasks for this workflow
    execution. This parameter overrides the defaultTaskStartToCloseTimout
    specified when registering the workflow type using RegisterWorkflowType .

    child_policy (string) --
    If set, specifies the policy to use for the child workflow executions of
    this workflow execution if it is terminated, by calling the
    TerminateWorkflowExecution action explicitly or due to an expired timeout.
    This policy overrides the default child policy specified when registering
    the workflow type using RegisterWorkflowType .

    lambda_role (string) --
    The ARN of an IAM role that authorizes Amazon SWF to invoke AWS Lambda
    functions.

    Returns the run id (string).
    The runId of a workflow execution. This ID is generated by the service and
    can be used to uniquely identify the workflow execution within a domain.

    return run_id (string)
    """
    kwargs = {}

    for aws_prop, value, conversion in (
        ('taskList', task_list, None),
        ('taskPriority', task_priority, str),
        ('input', _input, None),
        ('executionStartToCloseTimeout', execution_start_to_close_timeout,
         None),
        ('tagList', tag_list, None),
        ('taskStartToCloseTimeout', task_start_to_close_timeout, None),
        ('childPolicy', child_policy, None),
        ('lambdaRole', lambda_role, None)):

        kwargs = check_and_add_kwargs(aws_prop, value, conversion, kwargs)

    result = make_request(
        SWF.start_workflow_execution,
        domain=domain,
        workflowId=workflow_id,
        workflowType={
            'name': workflow_type_name,
            'version': workflow_type_version
        },
        **kwargs)

    if result.success:
        return result.result.get('runId')

    return StartWorkflowExecutionError(result.result.message)
Exemplo n.º 5
0
def register_activity_type(domain,
                           name,
                           version,
                           description=None,
                           default_task_start_to_close_timeout=None,
                           default_task_heartbeat_timeout=None,
                           default_task_list=None,
                           default_task_priority=None,
                           default_task_schedule_to_start_timeout=None,
                           default_task_schedule_to_close_timeout=None):
    """Registers a new activity type along with its configuration settings in
    the specified domain.

    WARNING
    A TypeAlreadyExists fault is returned if the type already exists in the
    domain. You cannot change any configuration settings of the type after its
    registration, and it must be registered as a new version.

    http://boto3.readthedocs.org/en/latest/reference/services/swf.html#SWF.Client.register_activity_type

    domain (string) -- [REQUIRED]
    The name of the domain in which this activity is to be registered.

    name (string) -- [REQUIRED]
    The name of the activity type within the domain.

    version (string) -- [REQUIRED]
    The version of the activity type.

    description (string) --
    A textual description of the activity type.

    default_task_start_to_close_timeout (string) --
    If set, specifies the default maximum duration that a worker can take to
    process tasks of this activity type. This default can be overridden when
    scheduling an activity task using the ScheduleActivityTask decision.

    default_task_heartbeat_timeout (string) --
    If set, specifies the default maximum time before which a worker processing
    a task of this type must report progress by calling
    RecordActivityTaskHeartbeat. If the timeout is exceeded, the activity task
    is automatically timed out. This default can be overridden when scheduling
    an activity task using the ScheduleActivityTask decision. If the activity
    worker subsequently attempts to record a heartbeat or returns a result, the
    activity worker receives an UnknownResource fault. In this case, Amazon SWF
    no longer considers the activity task to be valid; the activity worker
    should clean up the activity task.

        The duration is specified in seconds; an integer greater than or equal
        to 0. The value "NONE" can be used to specify unlimited duration.

    default_task_list (dict) --
    If set, specifies the default task list to use for scheduling tasks of this
    activity type. This default task list is used if a task list is not provided
    when a task is scheduled through the ScheduleActivityTask decision.

        name (string) -- [REQUIRED]
        The name of the task list.

    default_task_priority (int) --
    The default task priority to assign to the activity type. If not assigned,
    then "0" will be used. Valid values are integers that range from Java's
    Integer.MIN_VALUE (-2147483648) to Integer.MAX_VALUE (2147483647). Higher
    numbers indicate higher priority.

    default_task_schedule_to_start_timeout (string) --
    If set, specifies the default maximum duration that a task of this activity
    type can wait before being assigned to a worker. This default can be
    overridden when scheduling an activity task using the ScheduleActivityTask
    decision.

    default_task_schedule_to_close_timeout (string) --
    If set, specifies the default maximum duration for a task of this activity
    type. This default can be overridden when scheduling an activity task using
    the ScheduleActivityTask decision.

    return None
    """
    kwargs = {}

    for aws_prop, value, conversion in (
        ('description', description, None),
        ('defaultTaskStartToCloseTimeout', default_task_start_to_close_timeout,
         None), ('defaultTaskHeartbeatTimeout', default_task_heartbeat_timeout,
                 None), ('defaultTaskList', default_task_list, None),
        ('defaultTaskPriority', default_task_priority,
         str), ('defaultTaskScheduleToStartTimeout',
                default_task_schedule_to_start_timeout,
                None), ('defaultTaskScheduleToCloseTimeout',
                        default_task_schedule_to_close_timeout, None)):

        kwargs = check_and_add_kwargs(aws_prop, value, conversion, kwargs)

    result = make_request(SWF.register_activity_type,
                          domain=domain,
                          name=name,
                          version=version,
                          **kwargs)

    if result.success:
        return

    if result.result.code == ACITVITY_TYPE_ALREADY_EXISTS:
        raise ActivityTypeAlreadyExistsError("Workflow type already exists.")

    raise RegisterActivityError(result.result.message)
Exemplo n.º 6
0
def poll_for_decision_task(domain,
                           task_list,
                           identity=None,
                           next_page_token=None,
                           maximum_page_size=1000,
                           reverse_order=False):
    """Used by deciders to get a DecisionTask from the specified decision
    taskList . A decision task may be returned for any open workflow execution
    that is using the specified task list. The task includes a paginated view of
    the history of the workflow execution. The decider should use the workflow
    type and the history to determine how to properly handle the task.

    This action initiates a long poll, where the service holds the HTTP
    connection open and responds as soon a task becomes available. If no
    decision task is available in the specified task list before the timeout of
    60 seconds expires, an empty result is returned. An empty result, in this
    context, means that a DecisionTask is returned, but that the value of
    task_token is an empty string.

    http://boto3.readthedocs.org/en/latest/reference/services/swf.html#SWF.Client.poll_for_decision_task

    domain (string) -- [REQUIRED]
    The name of the domain containing the task lists to poll.

    task_list (dict) -- [REQUIRED]
    Specifies the task list to poll for decision tasks.

        ITEMS:
            name (string) -- [REQUIRED]
            The name of the task list.

    identity (string) -- Identity of the decider making the request, which is
    recorded in the DecisionTaskStarted event in the workflow history. This
    enables diagnostic tracing when problems arise. The form of this identity is
    user defined.

    next_page_token (string) --
    If a NextPageToken was returned by a previous call, there are more results
    available. To retrieve the next page of results, make the call again using
    the returned token in nextPageToken . Keep all other arguments unchanged.

    maximum_page_size (integer) --
    The maximum number of results that will be returned per call. nextPageToken
    can be used to obtain futher pages of results. The default is 1000, which is
    the maximum allowed page size. You can, however, specify a page size smaller
    than the maximum.

    reverse_order (boolean) --
    When set to true , returns the events in reverse order. By default the
    results are returned in ascending order of the eventTimestamp of the events.

    returns dict
    """
    kwargs = {}

    for aws_prop, value, conversion in (('identity', identity,
                                         None), ('maximumPageSize',
                                                 maximum_page_size, None),
                                        ('reverseOrder', reverse_order,
                                         None), ('nextPageToken',
                                                 next_page_token, None)):

        kwargs = check_and_add_kwargs(aws_prop, value, conversion, kwargs)

    result = make_request(SWF.poll_for_decision_task,
                          domain=domain,
                          taskList=task_list,
                          **kwargs)

    if result.success:
        return result.result

    return None
Exemplo n.º 7
0
def poll_for_decision_task(
    domain, task_list, identity=None, next_page_token=None, maximum_page_size=1000, reverse_order=False
):
    """Used by deciders to get a DecisionTask from the specified decision
    taskList . A decision task may be returned for any open workflow execution
    that is using the specified task list. The task includes a paginated view of
    the history of the workflow execution. The decider should use the workflow
    type and the history to determine how to properly handle the task.

    This action initiates a long poll, where the service holds the HTTP
    connection open and responds as soon a task becomes available. If no
    decision task is available in the specified task list before the timeout of
    60 seconds expires, an empty result is returned. An empty result, in this
    context, means that a DecisionTask is returned, but that the value of
    task_token is an empty string.

    http://boto3.readthedocs.org/en/latest/reference/services/swf.html#SWF.Client.poll_for_decision_task

    domain (string) -- [REQUIRED]
    The name of the domain containing the task lists to poll.

    task_list (dict) -- [REQUIRED]
    Specifies the task list to poll for decision tasks.

        ITEMS:
            name (string) -- [REQUIRED]
            The name of the task list.

    identity (string) -- Identity of the decider making the request, which is
    recorded in the DecisionTaskStarted event in the workflow history. This
    enables diagnostic tracing when problems arise. The form of this identity is
    user defined.

    next_page_token (string) --
    If a NextPageToken was returned by a previous call, there are more results
    available. To retrieve the next page of results, make the call again using
    the returned token in nextPageToken . Keep all other arguments unchanged.

    maximum_page_size (integer) --
    The maximum number of results that will be returned per call. nextPageToken
    can be used to obtain futher pages of results. The default is 1000, which is
    the maximum allowed page size. You can, however, specify a page size smaller
    than the maximum.

    reverse_order (boolean) --
    When set to true , returns the events in reverse order. By default the
    results are returned in ascending order of the eventTimestamp of the events.

    returns dict
    """
    kwargs = {}

    for aws_prop, value, conversion in (
        ("identity", identity, None),
        ("maximumPageSize", maximum_page_size, None),
        ("reverseOrder", reverse_order, None),
        ("nextPageToken", next_page_token, None),
    ):

        kwargs = check_and_add_kwargs(aws_prop, value, conversion, kwargs)

    result = make_request(SWF.poll_for_decision_task, domain=domain, taskList=task_list, **kwargs)

    if result.success:
        return result.result

    return None
Exemplo n.º 8
0
def start_workflow_execution(
    domain,
    workflow_id,
    workflow_type_name,
    workflow_type_version,
    task_list=None,
    task_priority=None,
    _input=None,
    execution_start_to_close_timeout=None,
    tag_list=None,
    child_policy=None,
    task_start_to_close_timeout=None,
    lambda_role=None,
):
    """Starts an execution of the workflow type in the specified domain using
    the provided workflowId and input data.

    This action returns the newly started workflow execution.

    http://boto3.readthedocs.org/en/latest/reference/services/swf.html#SWF.Client.start_workflow_execution

    domain (string) -- [REQUIRED]
    The name of the domain in which the workflow execution is created.

    workflow_id (string) -- [REQUIRED]
    The user defined identifier associated with the workflow execution. You can
    use this to associate a custom identifier with the workflow execution. You
    may specify the same identifier if a workflow execution is logically a
    restart of a previous execution. You cannot have two open workflow
    executions with the same workflowId at the same time.

    workflow_type (dict) -- [REQUIRED]
    The type of the workflow to start.

        ITEMS:
        name (string) -- [REQUIRED]
        Required. The name of the workflow type.

        version (string) -- [REQUIRED]
        Required. The version of the workflow type.

    task_list (dict) --
    The task list to use for the decision tasks generated for this workflow
    execution. This overrides the defaultTaskList specified when registering the
    workflow type.

        ITEMS:
        name (string) -- [REQUIRED]
        The name of the task list.

    task_priority (int) --
    The task priority to use for this workflow execution. This will override any
    default priority that was assigned when the workflow type was registered. If
    not set, then the default task priority for the workflow type will be used.
    Valid values are integers that range from Java's Integer.MIN_VALUE
    (-2147483648) to Integer.MAX_VALUE (2147483647). Higher numbers indicate
    higher priority.

    _input (string) --
    The input for the workflow execution. This is a free form string which
    should be meaningful to the workflow you are starting. This input is made
    available to the new workflow execution in the WorkflowExecutionStarted
    history event.

    execution_start_to_close_timeout (string) --
    The total duration for this workflow execution. This overrides the
    defaultExecutionStartToCloseTimeout specified when registering the workflow
    type.

    tag_list (list) --
    The list of tags to associate with the workflow execution. You can specify a
    maximum of 5 tags. You can list workflow executions with a specific tag by
    calling ListOpenWorkflowExecutions or ListClosedWorkflowExecutions and
    specifying a TagFilter .

    task_start_to_close_timeout (string) --
    Specifies the maximum duration of decision tasks for this workflow
    execution. This parameter overrides the defaultTaskStartToCloseTimout
    specified when registering the workflow type using RegisterWorkflowType .

    child_policy (string) --
    If set, specifies the policy to use for the child workflow executions of
    this workflow execution if it is terminated, by calling the
    TerminateWorkflowExecution action explicitly or due to an expired timeout.
    This policy overrides the default child policy specified when registering
    the workflow type using RegisterWorkflowType .

    lambda_role (string) --
    The ARN of an IAM role that authorizes Amazon SWF to invoke AWS Lambda
    functions.

    Returns the run id (string).
    The runId of a workflow execution. This ID is generated by the service and
    can be used to uniquely identify the workflow execution within a domain.

    return run_id (string)
    """
    kwargs = {}

    for aws_prop, value, conversion in (
        ("taskList", task_list, None),
        ("taskPriority", task_priority, str),
        ("input", _input, None),
        ("executionStartToCloseTimeout", execution_start_to_close_timeout, None),
        ("tagList", tag_list, None),
        ("taskStartToCloseTimeout", task_start_to_close_timeout, None),
        ("childPolicy", child_policy, None),
        ("lambdaRole", lambda_role, None),
    ):

        kwargs = check_and_add_kwargs(aws_prop, value, conversion, kwargs)

    result = make_request(
        SWF.start_workflow_execution,
        domain=domain,
        workflowId=workflow_id,
        workflowType={"name": workflow_type_name, "version": workflow_type_version},
        **kwargs
    )

    if result.success:
        return result.result.get("runId")

    return StartWorkflowExecutionError(result.result.message)