create_workflow
(**kwargs)¶Allows you to create a workflow with specified steps and step details the workflow invokes after file transfer completes. After creating a workflow, you can associate the workflow created with any transfer servers by specifying the workflow-details
field in CreateServer
and UpdateServer
operations.
See also: AWS API Documentation
Request Syntax
response = client.create_workflow(
Description='string',
Steps=[
{
'Type': 'COPY'|'CUSTOM'|'TAG'|'DELETE'|'DECRYPT',
'CopyStepDetails': {
'Name': 'string',
'DestinationFileLocation': {
'S3FileLocation': {
'Bucket': 'string',
'Key': 'string'
},
'EfsFileLocation': {
'FileSystemId': 'string',
'Path': 'string'
}
},
'OverwriteExisting': 'TRUE'|'FALSE',
'SourceFileLocation': 'string'
},
'CustomStepDetails': {
'Name': 'string',
'Target': 'string',
'TimeoutSeconds': 123,
'SourceFileLocation': 'string'
},
'DeleteStepDetails': {
'Name': 'string',
'SourceFileLocation': 'string'
},
'TagStepDetails': {
'Name': 'string',
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
],
'SourceFileLocation': 'string'
},
'DecryptStepDetails': {
'Name': 'string',
'Type': 'PGP',
'SourceFileLocation': 'string',
'OverwriteExisting': 'TRUE'|'FALSE',
'DestinationFileLocation': {
'S3FileLocation': {
'Bucket': 'string',
'Key': 'string'
},
'EfsFileLocation': {
'FileSystemId': 'string',
'Path': 'string'
}
}
}
},
],
OnExceptionSteps=[
{
'Type': 'COPY'|'CUSTOM'|'TAG'|'DELETE'|'DECRYPT',
'CopyStepDetails': {
'Name': 'string',
'DestinationFileLocation': {
'S3FileLocation': {
'Bucket': 'string',
'Key': 'string'
},
'EfsFileLocation': {
'FileSystemId': 'string',
'Path': 'string'
}
},
'OverwriteExisting': 'TRUE'|'FALSE',
'SourceFileLocation': 'string'
},
'CustomStepDetails': {
'Name': 'string',
'Target': 'string',
'TimeoutSeconds': 123,
'SourceFileLocation': 'string'
},
'DeleteStepDetails': {
'Name': 'string',
'SourceFileLocation': 'string'
},
'TagStepDetails': {
'Name': 'string',
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
],
'SourceFileLocation': 'string'
},
'DecryptStepDetails': {
'Name': 'string',
'Type': 'PGP',
'SourceFileLocation': 'string',
'OverwriteExisting': 'TRUE'|'FALSE',
'DestinationFileLocation': {
'S3FileLocation': {
'Bucket': 'string',
'Key': 'string'
},
'EfsFileLocation': {
'FileSystemId': 'string',
'Path': 'string'
}
}
}
},
],
Tags=[
{
'Key': 'string',
'Value': 'string'
},
]
)
[REQUIRED]
Specifies the details for the steps that are in the specified workflow.
The TYPE
specifies which of the following actions is being taken for this step.
COPY
- Copy the file to another location.CUSTOM
- Perform a custom step with an Lambda function target.DECRYPT
- Decrypt a file that was encrypted before it was uploaded.DELETE
- Delete the file.TAG
- Add a tag to the file.Note
Currently, copying and tagging are supported only on S3.
For file location, you specify either the Amazon S3 bucket and key, or the Amazon EFS file system ID and path.
The basic building block of a workflow.
Currently, the following step types are supported.
COPY
- Copy the file to another location.CUSTOM
- Perform a custom step with an Lambda function target.DECRYPT
- Decrypt a file that was encrypted before it was uploaded.DELETE
- Delete the file.TAG
- Add a tag to the file.Details for a step that performs a file copy.
Consists of the following values:
FALSE
.The name of the step, used as an identifier.
Specifies the location for the file being copied. Use ${Transfer:username}
or ${Transfer:UploadDate}
in this field to parametrize the destination prefix by username or uploaded date.
DestinationFileLocation
to ${Transfer:username}
to copy uploaded files to an Amazon S3 bucket that is prefixed with the name of the Transfer Family user that uploaded the file.DestinationFileLocation
to ${Transfer:UploadDate}
to copy uploaded files to an Amazon S3 bucket that is prefixed with the date of the upload.Note
The system resolves UploadDate
to a date format of YYYY-MM-DD , based on the date the file is uploaded.
Specifies the details for the Amazon S3 file that's being copied or decrypted.
Specifies the S3 bucket for the customer input file.
The name assigned to the file when it was created in Amazon S3. You use the object key to retrieve the object.
Specifies the details for the Amazon Elastic File System (Amazon EFS) file that's being decrypted.
The identifier of the file system, assigned by Amazon EFS.
The pathname for the folder being used by a workflow.
A flag that indicates whether to overwrite an existing file of the same name. The default is FALSE
.
Specifies which file to use as input to the workflow step: either the output from the previous step, or the originally uploaded file for the workflow.
${previous.file}
. In this case, this workflow step uses the output file from the previous workflow step as input. This is the default value.${original.file}
.Details for a step that invokes an Lambda function.
Consists of the Lambda function's name, target, and timeout (in seconds).
The name of the step, used as an identifier.
The ARN for the lambda function that is being called.
Timeout, in seconds, for the step.
Specifies which file to use as input to the workflow step: either the output from the previous step, or the originally uploaded file for the workflow.
${previous.file}
. In this case, this workflow step uses the output file from the previous workflow step as input. This is the default value.${original.file}
.Details for a step that deletes the file.
The name of the step, used as an identifier.
Specifies which file to use as input to the workflow step: either the output from the previous step, or the originally uploaded file for the workflow.
${previous.file}
. In this case, this workflow step uses the output file from the previous workflow step as input. This is the default value.${original.file}
.Details for a step that creates one or more tags.
You specify one or more tags. Each tag contains a key-value pair.
The name of the step, used as an identifier.
Array that contains from 1 to 10 key/value pairs.
Specifies the key-value pair that are assigned to a file during the execution of a Tagging step.
The name assigned to the tag that you create.
The value that corresponds to the key.
Specifies which file to use as input to the workflow step: either the output from the previous step, or the originally uploaded file for the workflow.
${previous.file}
. In this case, this workflow step uses the output file from the previous workflow step as input. This is the default value.${original.file}
.Details for a step that decrypts an encrypted file.
Consists of the following values:
FALSE
.The name of the step, used as an identifier.
The type of encryption used. Currently, this value must be PGP
.
Specifies which file to use as input to the workflow step: either the output from the previous step, or the originally uploaded file for the workflow.
${previous.file}
. In this case, this workflow step uses the output file from the previous workflow step as input. This is the default value.${original.file}
.A flag that indicates whether to overwrite an existing file of the same name. The default is FALSE
.
Specifies the location for the file that's being processed.
Specifies the details for the Amazon S3 file that's being copied or decrypted.
Specifies the S3 bucket for the customer input file.
The name assigned to the file when it was created in Amazon S3. You use the object key to retrieve the object.
Specifies the details for the Amazon Elastic File System (Amazon EFS) file that's being decrypted.
The identifier of the file system, assigned by Amazon EFS.
The pathname for the folder being used by a workflow.
Specifies the steps (actions) to take if errors are encountered during execution of the workflow.
Note
For custom steps, the lambda function needs to send FAILURE
to the call back API to kick off the exception steps. Additionally, if the lambda does not send SUCCESS
before it times out, the exception steps are executed.
The basic building block of a workflow.
Currently, the following step types are supported.
COPY
- Copy the file to another location.CUSTOM
- Perform a custom step with an Lambda function target.DECRYPT
- Decrypt a file that was encrypted before it was uploaded.DELETE
- Delete the file.TAG
- Add a tag to the file.Details for a step that performs a file copy.
Consists of the following values:
FALSE
.The name of the step, used as an identifier.
Specifies the location for the file being copied. Use ${Transfer:username}
or ${Transfer:UploadDate}
in this field to parametrize the destination prefix by username or uploaded date.
DestinationFileLocation
to ${Transfer:username}
to copy uploaded files to an Amazon S3 bucket that is prefixed with the name of the Transfer Family user that uploaded the file.DestinationFileLocation
to ${Transfer:UploadDate}
to copy uploaded files to an Amazon S3 bucket that is prefixed with the date of the upload.Note
The system resolves UploadDate
to a date format of YYYY-MM-DD , based on the date the file is uploaded.
Specifies the details for the Amazon S3 file that's being copied or decrypted.
Specifies the S3 bucket for the customer input file.
The name assigned to the file when it was created in Amazon S3. You use the object key to retrieve the object.
Specifies the details for the Amazon Elastic File System (Amazon EFS) file that's being decrypted.
The identifier of the file system, assigned by Amazon EFS.
The pathname for the folder being used by a workflow.
A flag that indicates whether to overwrite an existing file of the same name. The default is FALSE
.
Specifies which file to use as input to the workflow step: either the output from the previous step, or the originally uploaded file for the workflow.
${previous.file}
. In this case, this workflow step uses the output file from the previous workflow step as input. This is the default value.${original.file}
.Details for a step that invokes an Lambda function.
Consists of the Lambda function's name, target, and timeout (in seconds).
The name of the step, used as an identifier.
The ARN for the lambda function that is being called.
Timeout, in seconds, for the step.
Specifies which file to use as input to the workflow step: either the output from the previous step, or the originally uploaded file for the workflow.
${previous.file}
. In this case, this workflow step uses the output file from the previous workflow step as input. This is the default value.${original.file}
.Details for a step that deletes the file.
The name of the step, used as an identifier.
Specifies which file to use as input to the workflow step: either the output from the previous step, or the originally uploaded file for the workflow.
${previous.file}
. In this case, this workflow step uses the output file from the previous workflow step as input. This is the default value.${original.file}
.Details for a step that creates one or more tags.
You specify one or more tags. Each tag contains a key-value pair.
The name of the step, used as an identifier.
Array that contains from 1 to 10 key/value pairs.
Specifies the key-value pair that are assigned to a file during the execution of a Tagging step.
The name assigned to the tag that you create.
The value that corresponds to the key.
Specifies which file to use as input to the workflow step: either the output from the previous step, or the originally uploaded file for the workflow.
${previous.file}
. In this case, this workflow step uses the output file from the previous workflow step as input. This is the default value.${original.file}
.Details for a step that decrypts an encrypted file.
Consists of the following values:
FALSE
.The name of the step, used as an identifier.
The type of encryption used. Currently, this value must be PGP
.
Specifies which file to use as input to the workflow step: either the output from the previous step, or the originally uploaded file for the workflow.
${previous.file}
. In this case, this workflow step uses the output file from the previous workflow step as input. This is the default value.${original.file}
.A flag that indicates whether to overwrite an existing file of the same name. The default is FALSE
.
Specifies the location for the file that's being processed.
Specifies the details for the Amazon S3 file that's being copied or decrypted.
Specifies the S3 bucket for the customer input file.
The name assigned to the file when it was created in Amazon S3. You use the object key to retrieve the object.
Specifies the details for the Amazon Elastic File System (Amazon EFS) file that's being decrypted.
The identifier of the file system, assigned by Amazon EFS.
The pathname for the folder being used by a workflow.
Key-value pairs that can be used to group and search for workflows. Tags are metadata attached to workflows for any purpose.
Creates a key-value pair for a specific resource. Tags are metadata that you can use to search for and group a resource for various purposes. You can apply tags to servers, users, and roles. A tag key can take more than one value. For example, to group servers for accounting purposes, you might create a tag called Group
and assign the values Research
and Accounting
to that group.
The name assigned to the tag that you create.
Contains one or more values that you assigned to the key name you create.
dict
Response Syntax
{
'WorkflowId': 'string'
}
Response Structure
(dict) --
WorkflowId (string) --
A unique identifier for the workflow.
Exceptions
Transfer.Client.exceptions.AccessDeniedException
Transfer.Client.exceptions.ServiceUnavailableException
Transfer.Client.exceptions.InternalServiceError
Transfer.Client.exceptions.InvalidRequestException
Transfer.Client.exceptions.ResourceExistsException
Transfer.Client.exceptions.ThrottlingException