RegisterWorkflowType - Amazon Simple Workflow Service

RegisterWorkflowType

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.

Important

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.

Access Control

You can use IAM policies to control this action's access to Amazon SWF resources as follows:

  • Use a Resource element with the domain name to limit the action to only specified domains.

  • Use an Action element to allow or deny permission to call this action.

  • Constrain the following parameters by using a Condition element with the appropriate keys.

    • defaultTaskList.name: String constraint. The key is swf:defaultTaskList.name.

    • name: String constraint. The key is swf:name.

    • version: String constraint. The key is swf:version.

If the caller doesn't have sufficient permissions to invoke the action, or the parameter values fall outside the specified constraints, the action fails. The associated event attribute's cause parameter is set to OPERATION_NOT_PERMITTED. For details and example IAM policies, see Using IAM to Manage Access to Amazon SWF Workflows in the Amazon SWF Developer Guide.

Request Syntax

{ "defaultChildPolicy": "string", "defaultExecutionStartToCloseTimeout": "string", "defaultLambdaRole": "string", "defaultTaskList": { "name": "string" }, "defaultTaskPriority": "string", "defaultTaskStartToCloseTimeout": "string", "description": "string", "domain": "string", "name": "string", "version": "string" }

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

The request accepts the following data in JSON format.

defaultChildPolicy

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 are terminated.

  • REQUEST_CANCEL – A request to cancel is 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 is taken. The child executions continue to run.

Type: String

Valid Values: TERMINATE | REQUEST_CANCEL | ABANDON

Required: No

defaultExecutionStartToCloseTimeout

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.

The duration is specified in seconds; an integer greater than or equal to 0. Unlike some of the other timeout parameters in Amazon SWF, you cannot specify a value of "NONE" for defaultExecutionStartToCloseTimeout; there is a one-year max limit on the time that a workflow execution can run. Exceeding this limit always causes the workflow execution to time out.

Type: String

Length Constraints: Maximum length of 8.

Required: No

defaultLambdaRole

The default IAM role attached to this workflow type.

Note

Executions of this workflow type need IAM roles to invoke Lambda functions. If you don't specify an IAM role when you start this workflow type, the default Lambda role is attached to the execution. For more information, see https://docs.aws.amazon.com/amazonswf/latest/developerguide/lambda-task.html in the Amazon SWF Developer Guide.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 1600.

Required: No

defaultTaskList

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 isn't provided when starting the execution through the StartWorkflowExecution Action or StartChildWorkflowExecution Decision.

Type: TaskList object

Required: No

defaultTaskPriority

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

For more information about setting task priority, see Setting Task Priority in the Amazon SWF Developer Guide.

Type: String

Required: No

defaultTaskStartToCloseTimeout

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.

The duration is specified in seconds, an integer greater than or equal to 0. You can use NONE to specify unlimited duration.

Type: String

Length Constraints: Maximum length of 8.

Required: No

description

Textual description of the workflow type.

Type: String

Length Constraints: Maximum length of 1024.

Required: No

domain

The name of the domain in which to register the workflow type.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 256.

Required: Yes

name

The name of the workflow type.

The specified string must not contain a : (colon), / (slash), | (vertical bar), or any control characters (\u0000-\u001f | \u007f-\u009f). Also, it must not be the literal string arn.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 256.

Required: Yes

version

The version of the workflow type.

Note

The workflow type consists of the name and version, the combination of which must be unique within the domain. To get a list of all currently registered workflow types, use the ListWorkflowTypes action.

The specified string must not contain a : (colon), / (slash), | (vertical bar), or any control characters (\u0000-\u001f | \u007f-\u009f). Also, it must not be the literal string arn.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 64.

Required: Yes

Response Elements

If the action is successful, the service sends back an HTTP 200 response with an empty HTTP body.

Errors

For information about the errors that are common to all actions, see Common Errors.

LimitExceededFault

Returned by any operation if a system imposed limitation has been reached. To address this fault you should either clean up unused resources or increase the limit by contacting AWS.

HTTP Status Code: 400

OperationNotPermittedFault

Returned when the caller doesn't have sufficient permissions to invoke the action.

HTTP Status Code: 400

TypeAlreadyExistsFault

Returned if the type already exists in the specified domain. You may get this fault if you are registering a type that is either already registered or deprecated, or if you undeprecate a type that is currently registered.

HTTP Status Code: 400

UnknownResourceFault

Returned when the named resource cannot be found with in the scope of this operation (region or domain). This could happen if the named resource was never created or is no longer available for this operation.

HTTP Status Code: 400

Examples

RegisterWorkflowType Example

This example illustrates one usage of RegisterWorkflowType.

Sample Request

POST / HTTP/1.1 Host: swf.us-east-1.amazonaws.com User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.25) Gecko/20111212 Firefox/3.6.25 ( .NET CLR 3.5.30729; .NET4.0E) Accept: application/json, text/javascript, */* Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip,deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive: 115 Connection: keep-alive Content-Type: application/x-amz-json-1.0 X-Requested-With: XMLHttpRequest X-Amz-Date: Fri, 13 Jan 2012 18:59:33 GMT X-Amz-Target: SimpleWorkflowService.RegisterWorkflowType Content-Encoding: amz-1.0 X-Amzn-Authorization: AWS3 AWSAccessKeyId=AKIAIOSFODNN7EXAMPLE,Algorithm=HmacSHA256,SignedHeaders=Host;X-Amz-Date;X-Amz-Target;Content-Encoding,Signature=p5FUOoV3QXAafb7aK5z79Ztu5v0w9NeEqLu0ei+P9FA= Referer: http://swf.us-east-1.amazonaws.com/explorer/index.html Content-Length: 300 Pragma: no-cache Cache-Control: no-cache { "defaultExecutionStartToCloseTimeout": "3600", "domain": "867530901", "name": "customerOrderWorkflow", "defaultChildPolicy": "TERMINATE", "defaultTaskPriority": "10", "defaultTaskStartToCloseTimeout": "600", "version": "1.0", "defaultTaskList": { "name": "mainTaskList" }, "description": "Handle customer orders" }

Sample Response

HTTP/1.1 200 OK Content-Length: 0 Content-Type: application/json x-amzn-RequestId: bb469e67-3e18-11e1-9914-a356b6ea8bdf

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: