CreateFlowCommand

Enables your application to create a new flow using Amazon AppFlow. You must create a connector profile before calling this API. Please note that the Request Syntax below shows syntax for multiple destinations, however, you can only transfer data to one item in this list at a time. Amazon AppFlow does not currently support flows to multiple destinations at once.

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { AppflowClient, CreateFlowCommand } from "@aws-sdk/client-appflow"; // ES Modules import
// const { AppflowClient, CreateFlowCommand } = require("@aws-sdk/client-appflow"); // CommonJS import
const client = new AppflowClient(config);
const input = { // CreateFlowRequest
  flowName: "STRING_VALUE", // required
  description: "STRING_VALUE",
  kmsArn: "STRING_VALUE",
  triggerConfig: { // TriggerConfig
    triggerType: "Scheduled" || "Event" || "OnDemand", // required
    triggerProperties: { // TriggerProperties
      Scheduled: { // ScheduledTriggerProperties
        scheduleExpression: "STRING_VALUE", // required
        dataPullMode: "Incremental" || "Complete",
        scheduleStartTime: new Date("TIMESTAMP"),
        scheduleEndTime: new Date("TIMESTAMP"),
        timezone: "STRING_VALUE",
        scheduleOffset: Number("long"),
        firstExecutionFrom: new Date("TIMESTAMP"),
        flowErrorDeactivationThreshold: Number("int"),
      },
    },
  },
  sourceFlowConfig: { // SourceFlowConfig
    connectorType: "Salesforce" || "Singular" || "Slack" || "Redshift" || "S3" || "Marketo" || "Googleanalytics" || "Zendesk" || "Servicenow" || "Datadog" || "Trendmicro" || "Snowflake" || "Dynatrace" || "Infornexus" || "Amplitude" || "Veeva" || "EventBridge" || "LookoutMetrics" || "Upsolver" || "Honeycode" || "CustomerProfiles" || "SAPOData" || "CustomConnector" || "Pardot", // required
    apiVersion: "STRING_VALUE",
    connectorProfileName: "STRING_VALUE",
    sourceConnectorProperties: { // SourceConnectorProperties
      Amplitude: { // AmplitudeSourceProperties
        object: "STRING_VALUE", // required
      },
      Datadog: { // DatadogSourceProperties
        object: "STRING_VALUE", // required
      },
      Dynatrace: { // DynatraceSourceProperties
        object: "STRING_VALUE", // required
      },
      GoogleAnalytics: { // GoogleAnalyticsSourceProperties
        object: "STRING_VALUE", // required
      },
      InforNexus: { // InforNexusSourceProperties
        object: "STRING_VALUE", // required
      },
      Marketo: { // MarketoSourceProperties
        object: "STRING_VALUE", // required
      },
      S3: { // S3SourceProperties
        bucketName: "STRING_VALUE", // required
        bucketPrefix: "STRING_VALUE",
        s3InputFormatConfig: { // S3InputFormatConfig
          s3InputFileType: "CSV" || "JSON",
        },
      },
      Salesforce: { // SalesforceSourceProperties
        object: "STRING_VALUE", // required
        enableDynamicFieldUpdate: true || false,
        includeDeletedRecords: true || false,
        dataTransferApi: "AUTOMATIC" || "BULKV2" || "REST_SYNC",
      },
      ServiceNow: { // ServiceNowSourceProperties
        object: "STRING_VALUE", // required
      },
      Singular: { // SingularSourceProperties
        object: "STRING_VALUE", // required
      },
      Slack: { // SlackSourceProperties
        object: "STRING_VALUE", // required
      },
      Trendmicro: { // TrendmicroSourceProperties
        object: "STRING_VALUE", // required
      },
      Veeva: { // VeevaSourceProperties
        object: "STRING_VALUE", // required
        documentType: "STRING_VALUE",
        includeSourceFiles: true || false,
        includeRenditions: true || false,
        includeAllVersions: true || false,
      },
      Zendesk: { // ZendeskSourceProperties
        object: "STRING_VALUE", // required
      },
      SAPOData: { // SAPODataSourceProperties
        objectPath: "STRING_VALUE",
        parallelismConfig: { // SAPODataParallelismConfig
          maxParallelism: Number("int"), // required
        },
        paginationConfig: { // SAPODataPaginationConfig
          maxPageSize: Number("int"), // required
        },
      },
      CustomConnector: { // CustomConnectorSourceProperties
        entityName: "STRING_VALUE", // required
        customProperties: { // CustomProperties
          "<keys>": "STRING_VALUE",
        },
        dataTransferApi: { // DataTransferApi
          Name: "STRING_VALUE",
          Type: "SYNC" || "ASYNC" || "AUTOMATIC",
        },
      },
      Pardot: { // PardotSourceProperties
        object: "STRING_VALUE", // required
      },
    },
    incrementalPullConfig: { // IncrementalPullConfig
      datetimeTypeFieldName: "STRING_VALUE",
    },
  },
  destinationFlowConfigList: [ // DestinationFlowConfigList // required
    { // DestinationFlowConfig
      connectorType: "Salesforce" || "Singular" || "Slack" || "Redshift" || "S3" || "Marketo" || "Googleanalytics" || "Zendesk" || "Servicenow" || "Datadog" || "Trendmicro" || "Snowflake" || "Dynatrace" || "Infornexus" || "Amplitude" || "Veeva" || "EventBridge" || "LookoutMetrics" || "Upsolver" || "Honeycode" || "CustomerProfiles" || "SAPOData" || "CustomConnector" || "Pardot", // required
      apiVersion: "STRING_VALUE",
      connectorProfileName: "STRING_VALUE",
      destinationConnectorProperties: { // DestinationConnectorProperties
        Redshift: { // RedshiftDestinationProperties
          object: "STRING_VALUE", // required
          intermediateBucketName: "STRING_VALUE", // required
          bucketPrefix: "STRING_VALUE",
          errorHandlingConfig: { // ErrorHandlingConfig
            failOnFirstDestinationError: true || false,
            bucketPrefix: "STRING_VALUE",
            bucketName: "STRING_VALUE",
          },
        },
        S3: { // S3DestinationProperties
          bucketName: "STRING_VALUE", // required
          bucketPrefix: "STRING_VALUE",
          s3OutputFormatConfig: { // S3OutputFormatConfig
            fileType: "CSV" || "JSON" || "PARQUET",
            prefixConfig: { // PrefixConfig
              prefixType: "FILENAME" || "PATH" || "PATH_AND_FILENAME",
              prefixFormat: "YEAR" || "MONTH" || "DAY" || "HOUR" || "MINUTE",
              pathPrefixHierarchy: [ // PathPrefixHierarchy
                "EXECUTION_ID" || "SCHEMA_VERSION",
              ],
            },
            aggregationConfig: { // AggregationConfig
              aggregationType: "None" || "SingleFile",
              targetFileSize: Number("long"),
            },
            preserveSourceDataTyping: true || false,
          },
        },
        Salesforce: { // SalesforceDestinationProperties
          object: "STRING_VALUE", // required
          idFieldNames: [ // IdFieldNameList
            "STRING_VALUE",
          ],
          errorHandlingConfig: {
            failOnFirstDestinationError: true || false,
            bucketPrefix: "STRING_VALUE",
            bucketName: "STRING_VALUE",
          },
          writeOperationType: "INSERT" || "UPSERT" || "UPDATE" || "DELETE",
          dataTransferApi: "AUTOMATIC" || "BULKV2" || "REST_SYNC",
        },
        Snowflake: { // SnowflakeDestinationProperties
          object: "STRING_VALUE", // required
          intermediateBucketName: "STRING_VALUE", // required
          bucketPrefix: "STRING_VALUE",
          errorHandlingConfig: {
            failOnFirstDestinationError: true || false,
            bucketPrefix: "STRING_VALUE",
            bucketName: "STRING_VALUE",
          },
        },
        EventBridge: { // EventBridgeDestinationProperties
          object: "STRING_VALUE", // required
          errorHandlingConfig: {
            failOnFirstDestinationError: true || false,
            bucketPrefix: "STRING_VALUE",
            bucketName: "STRING_VALUE",
          },
        },
        LookoutMetrics: {},
        Upsolver: { // UpsolverDestinationProperties
          bucketName: "STRING_VALUE", // required
          bucketPrefix: "STRING_VALUE",
          s3OutputFormatConfig: { // UpsolverS3OutputFormatConfig
            fileType: "CSV" || "JSON" || "PARQUET",
            prefixConfig: {
              prefixType: "FILENAME" || "PATH" || "PATH_AND_FILENAME",
              prefixFormat: "YEAR" || "MONTH" || "DAY" || "HOUR" || "MINUTE",
              pathPrefixHierarchy: [
                "EXECUTION_ID" || "SCHEMA_VERSION",
              ],
            },
            aggregationConfig: {
              aggregationType: "None" || "SingleFile",
              targetFileSize: Number("long"),
            },
          },
        },
        Honeycode: { // HoneycodeDestinationProperties
          object: "STRING_VALUE", // required
          errorHandlingConfig: {
            failOnFirstDestinationError: true || false,
            bucketPrefix: "STRING_VALUE",
            bucketName: "STRING_VALUE",
          },
        },
        CustomerProfiles: { // CustomerProfilesDestinationProperties
          domainName: "STRING_VALUE", // required
          objectTypeName: "STRING_VALUE",
        },
        Zendesk: { // ZendeskDestinationProperties
          object: "STRING_VALUE", // required
          idFieldNames: [
            "STRING_VALUE",
          ],
          errorHandlingConfig: "<ErrorHandlingConfig>",
          writeOperationType: "INSERT" || "UPSERT" || "UPDATE" || "DELETE",
        },
        Marketo: { // MarketoDestinationProperties
          object: "STRING_VALUE", // required
          errorHandlingConfig: "<ErrorHandlingConfig>",
        },
        CustomConnector: { // CustomConnectorDestinationProperties
          entityName: "STRING_VALUE", // required
          errorHandlingConfig: "<ErrorHandlingConfig>",
          writeOperationType: "INSERT" || "UPSERT" || "UPDATE" || "DELETE",
          idFieldNames: [
            "STRING_VALUE",
          ],
          customProperties: {
            "<keys>": "STRING_VALUE",
          },
        },
        SAPOData: { // SAPODataDestinationProperties
          objectPath: "STRING_VALUE", // required
          successResponseHandlingConfig: { // SuccessResponseHandlingConfig
            bucketPrefix: "STRING_VALUE",
            bucketName: "STRING_VALUE",
          },
          idFieldNames: [
            "STRING_VALUE",
          ],
          errorHandlingConfig: "<ErrorHandlingConfig>",
          writeOperationType: "INSERT" || "UPSERT" || "UPDATE" || "DELETE",
        },
      },
    },
  ],
  tasks: [ // Tasks // required
    { // Task
      sourceFields: [ // SourceFields // required
        "STRING_VALUE",
      ],
      connectorOperator: { // ConnectorOperator
        Amplitude: "BETWEEN",
        Datadog: "PROJECTION" || "BETWEEN" || "EQUAL_TO" || "ADDITION" || "MULTIPLICATION" || "DIVISION" || "SUBTRACTION" || "MASK_ALL" || "MASK_FIRST_N" || "MASK_LAST_N" || "VALIDATE_NON_NULL" || "VALIDATE_NON_ZERO" || "VALIDATE_NON_NEGATIVE" || "VALIDATE_NUMERIC" || "NO_OP",
        Dynatrace: "PROJECTION" || "BETWEEN" || "EQUAL_TO" || "ADDITION" || "MULTIPLICATION" || "DIVISION" || "SUBTRACTION" || "MASK_ALL" || "MASK_FIRST_N" || "MASK_LAST_N" || "VALIDATE_NON_NULL" || "VALIDATE_NON_ZERO" || "VALIDATE_NON_NEGATIVE" || "VALIDATE_NUMERIC" || "NO_OP",
        GoogleAnalytics: "PROJECTION" || "BETWEEN",
        InforNexus: "PROJECTION" || "BETWEEN" || "EQUAL_TO" || "ADDITION" || "MULTIPLICATION" || "DIVISION" || "SUBTRACTION" || "MASK_ALL" || "MASK_FIRST_N" || "MASK_LAST_N" || "VALIDATE_NON_NULL" || "VALIDATE_NON_ZERO" || "VALIDATE_NON_NEGATIVE" || "VALIDATE_NUMERIC" || "NO_OP",
        Marketo: "PROJECTION" || "LESS_THAN" || "GREATER_THAN" || "BETWEEN" || "ADDITION" || "MULTIPLICATION" || "DIVISION" || "SUBTRACTION" || "MASK_ALL" || "MASK_FIRST_N" || "MASK_LAST_N" || "VALIDATE_NON_NULL" || "VALIDATE_NON_ZERO" || "VALIDATE_NON_NEGATIVE" || "VALIDATE_NUMERIC" || "NO_OP",
        S3: "PROJECTION" || "LESS_THAN" || "GREATER_THAN" || "BETWEEN" || "LESS_THAN_OR_EQUAL_TO" || "GREATER_THAN_OR_EQUAL_TO" || "EQUAL_TO" || "NOT_EQUAL_TO" || "ADDITION" || "MULTIPLICATION" || "DIVISION" || "SUBTRACTION" || "MASK_ALL" || "MASK_FIRST_N" || "MASK_LAST_N" || "VALIDATE_NON_NULL" || "VALIDATE_NON_ZERO" || "VALIDATE_NON_NEGATIVE" || "VALIDATE_NUMERIC" || "NO_OP",
        Salesforce: "PROJECTION" || "LESS_THAN" || "CONTAINS" || "GREATER_THAN" || "BETWEEN" || "LESS_THAN_OR_EQUAL_TO" || "GREATER_THAN_OR_EQUAL_TO" || "EQUAL_TO" || "NOT_EQUAL_TO" || "ADDITION" || "MULTIPLICATION" || "DIVISION" || "SUBTRACTION" || "MASK_ALL" || "MASK_FIRST_N" || "MASK_LAST_N" || "VALIDATE_NON_NULL" || "VALIDATE_NON_ZERO" || "VALIDATE_NON_NEGATIVE" || "VALIDATE_NUMERIC" || "NO_OP",
        ServiceNow: "PROJECTION" || "CONTAINS" || "LESS_THAN" || "GREATER_THAN" || "BETWEEN" || "LESS_THAN_OR_EQUAL_TO" || "GREATER_THAN_OR_EQUAL_TO" || "EQUAL_TO" || "NOT_EQUAL_TO" || "ADDITION" || "MULTIPLICATION" || "DIVISION" || "SUBTRACTION" || "MASK_ALL" || "MASK_FIRST_N" || "MASK_LAST_N" || "VALIDATE_NON_NULL" || "VALIDATE_NON_ZERO" || "VALIDATE_NON_NEGATIVE" || "VALIDATE_NUMERIC" || "NO_OP",
        Singular: "PROJECTION" || "EQUAL_TO" || "ADDITION" || "MULTIPLICATION" || "DIVISION" || "SUBTRACTION" || "MASK_ALL" || "MASK_FIRST_N" || "MASK_LAST_N" || "VALIDATE_NON_NULL" || "VALIDATE_NON_ZERO" || "VALIDATE_NON_NEGATIVE" || "VALIDATE_NUMERIC" || "NO_OP",
        Slack: "PROJECTION" || "LESS_THAN" || "GREATER_THAN" || "BETWEEN" || "LESS_THAN_OR_EQUAL_TO" || "GREATER_THAN_OR_EQUAL_TO" || "EQUAL_TO" || "ADDITION" || "MULTIPLICATION" || "DIVISION" || "SUBTRACTION" || "MASK_ALL" || "MASK_FIRST_N" || "MASK_LAST_N" || "VALIDATE_NON_NULL" || "VALIDATE_NON_ZERO" || "VALIDATE_NON_NEGATIVE" || "VALIDATE_NUMERIC" || "NO_OP",
        Trendmicro: "PROJECTION" || "EQUAL_TO" || "ADDITION" || "MULTIPLICATION" || "DIVISION" || "SUBTRACTION" || "MASK_ALL" || "MASK_FIRST_N" || "MASK_LAST_N" || "VALIDATE_NON_NULL" || "VALIDATE_NON_ZERO" || "VALIDATE_NON_NEGATIVE" || "VALIDATE_NUMERIC" || "NO_OP",
        Veeva: "PROJECTION" || "LESS_THAN" || "GREATER_THAN" || "CONTAINS" || "BETWEEN" || "LESS_THAN_OR_EQUAL_TO" || "GREATER_THAN_OR_EQUAL_TO" || "EQUAL_TO" || "NOT_EQUAL_TO" || "ADDITION" || "MULTIPLICATION" || "DIVISION" || "SUBTRACTION" || "MASK_ALL" || "MASK_FIRST_N" || "MASK_LAST_N" || "VALIDATE_NON_NULL" || "VALIDATE_NON_ZERO" || "VALIDATE_NON_NEGATIVE" || "VALIDATE_NUMERIC" || "NO_OP",
        Zendesk: "PROJECTION" || "GREATER_THAN" || "ADDITION" || "MULTIPLICATION" || "DIVISION" || "SUBTRACTION" || "MASK_ALL" || "MASK_FIRST_N" || "MASK_LAST_N" || "VALIDATE_NON_NULL" || "VALIDATE_NON_ZERO" || "VALIDATE_NON_NEGATIVE" || "VALIDATE_NUMERIC" || "NO_OP",
        SAPOData: "PROJECTION" || "LESS_THAN" || "CONTAINS" || "GREATER_THAN" || "BETWEEN" || "LESS_THAN_OR_EQUAL_TO" || "GREATER_THAN_OR_EQUAL_TO" || "EQUAL_TO" || "NOT_EQUAL_TO" || "ADDITION" || "MULTIPLICATION" || "DIVISION" || "SUBTRACTION" || "MASK_ALL" || "MASK_FIRST_N" || "MASK_LAST_N" || "VALIDATE_NON_NULL" || "VALIDATE_NON_ZERO" || "VALIDATE_NON_NEGATIVE" || "VALIDATE_NUMERIC" || "NO_OP",
        CustomConnector: "PROJECTION" || "LESS_THAN" || "GREATER_THAN" || "CONTAINS" || "BETWEEN" || "LESS_THAN_OR_EQUAL_TO" || "GREATER_THAN_OR_EQUAL_TO" || "EQUAL_TO" || "NOT_EQUAL_TO" || "ADDITION" || "MULTIPLICATION" || "DIVISION" || "SUBTRACTION" || "MASK_ALL" || "MASK_FIRST_N" || "MASK_LAST_N" || "VALIDATE_NON_NULL" || "VALIDATE_NON_ZERO" || "VALIDATE_NON_NEGATIVE" || "VALIDATE_NUMERIC" || "NO_OP",
        Pardot: "PROJECTION" || "EQUAL_TO" || "NO_OP" || "ADDITION" || "MULTIPLICATION" || "DIVISION" || "SUBTRACTION" || "MASK_ALL" || "MASK_FIRST_N" || "MASK_LAST_N" || "VALIDATE_NON_NULL" || "VALIDATE_NON_ZERO" || "VALIDATE_NON_NEGATIVE" || "VALIDATE_NUMERIC",
      },
      destinationField: "STRING_VALUE",
      taskType: "Arithmetic" || "Filter" || "Map" || "Map_all" || "Mask" || "Merge" || "Passthrough" || "Truncate" || "Validate" || "Partition", // required
      taskProperties: { // TaskPropertiesMap
        "<keys>": "STRING_VALUE",
      },
    },
  ],
  tags: { // TagMap
    "<keys>": "STRING_VALUE",
  },
  metadataCatalogConfig: { // MetadataCatalogConfig
    glueDataCatalog: { // GlueDataCatalogConfig
      roleArn: "STRING_VALUE", // required
      databaseName: "STRING_VALUE", // required
      tablePrefix: "STRING_VALUE", // required
    },
  },
  clientToken: "STRING_VALUE",
};
const command = new CreateFlowCommand(input);
const response = await client.send(command);
// { // CreateFlowResponse
//   flowArn: "STRING_VALUE",
//   flowStatus: "Active" || "Deprecated" || "Deleted" || "Draft" || "Errored" || "Suspended",
// };

CreateFlowCommand Input

See CreateFlowCommandInput for more details

Parameter
Type
Description
destinationFlowConfigList
Required
DestinationFlowConfig[] | undefined

The configuration that controls how Amazon AppFlow places data in the destination connector.

flowName
Required
string | undefined

The specified name of the flow. Spaces are not allowed. Use underscores (_) or hyphens (-) only.

sourceFlowConfig
Required
SourceFlowConfig | undefined

The configuration that controls how Amazon AppFlow retrieves data from the source connector.

tasks
Required
Task[] | undefined

A list of tasks that Amazon AppFlow performs while transferring the data in the flow run.

triggerConfig
Required
TriggerConfig | undefined

The trigger settings that determine how and when the flow runs.

clientToken
string | undefined

The clientToken parameter is an idempotency token. It ensures that your CreateFlow request completes only once. You choose the value to pass. For example, if you don't receive a response from your request, you can safely retry the request with the same clientToken parameter value.

If you omit a clientToken value, the Amazon Web Services SDK that you are using inserts a value for you. This way, the SDK can safely retry requests multiple times after a network error. You must provide your own value for other use cases.

If you specify input parameters that differ from your first request, an error occurs. If you use a different value for clientToken, Amazon AppFlow considers it a new call to CreateFlow. The token is active for 8 hours.

description
string | undefined

A description of the flow you want to create.

kmsArn
string | undefined

The ARN (Amazon Resource Name) of the Key Management Service (KMS) key you provide for encryption. This is required if you do not want to use the Amazon AppFlow-managed KMS key. If you don't provide anything here, Amazon AppFlow uses the Amazon AppFlow-managed KMS key.

metadataCatalogConfig
MetadataCatalogConfig | undefined

Specifies the configuration that Amazon AppFlow uses when it catalogs the data that's transferred by the associated flow. When Amazon AppFlow catalogs the data from a flow, it stores metadata in a data catalog.

tags
Record<string, string> | undefined

The tags used to organize, track, or control access for your flow.

CreateFlowCommand Output

See CreateFlowCommandOutput for details

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
flowArn
string | undefined

The flow's Amazon Resource Name (ARN).

flowStatus
FlowStatus | undefined

Indicates the current status of the flow.

Throws

Name
Fault
Details
AccessDeniedException
client

AppFlow/Requester has invalid or missing permissions.

ConflictException
client

There was a conflict when processing the request (for example, a flow with the given name already exists within the account. Check for conflicting resource names and try again.

ConnectorAuthenticationException
client

An error occurred when authenticating with the connector endpoint.

ConnectorServerException
client

An error occurred when retrieving data from the connector endpoint.

InternalServerException
server

An internal service error occurred during the processing of your request. Try again later.

ResourceNotFoundException
client

The resource specified in the request (such as the source or destination connector profile) is not found.

ServiceQuotaExceededException
client

The request would cause a service quota (such as the number of flows) to be exceeded.

ValidationException
client

The request has invalid or missing parameters.

AppflowServiceException
Base exception class for all service exceptions from Appflow service.