# CfnFlow

The `AWS::AppFlow::Flow` resource is an Amazon AppFlow resource type that specifies a new flow.

> If you want to use CloudFormation to create a connector profile for connectors that implement OAuth (such as Salesforce, Slack, Zendesk, and Google Analytics), you must fetch the access and refresh tokens. You can do this by implementing your own UI for OAuth, or by retrieving the tokens from elsewhere. Alternatively, you can use the Amazon AppFlow console to create the connector profile, and then use that connector profile in the flow creation CloudFormation template.

Extends: Construct › CfnElement › CfnRefElement › CfnResource › CfnFlow
Implements: IInspectable, ITaggable, IEnvironmentAware, IFlowRef, IConstruct, IDependable

- CloudFormation: [`AWS::AppFlow::Flow`](https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/aws-resource-appflow-flow.html)
- Source: Generated code
- Type last changed: v2.252.0 · 30 Apr 2026

## Example

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_appflow as appflow } from 'aws-cdk-lib';
const cfnFlow = new appflow.CfnFlow(this, 'MyCfnFlow', {
  destinationFlowConfigList: [{
    connectorType: 'connectorType',
    destinationConnectorProperties: {
      customConnector: {
        entityName: 'entityName',

        // the properties below are optional
        customProperties: {
          customPropertiesKey: 'customProperties',
        },
        errorHandlingConfig: {
          bucketName: 'bucketName',
          bucketPrefix: 'bucketPrefix',
          failOnFirstError: false,
        },
        idFieldNames: ['idFieldNames'],
        writeOperationType: 'writeOperationType',
      },
      eventBridge: {
        object: 'object',

        // the properties below are optional
        errorHandlingConfig: {
          bucketName: 'bucketName',
          bucketPrefix: 'bucketPrefix',
          failOnFirstError: false,
        },
      },
      lookoutMetrics: {
        object: 'object',
      },
      marketo: {
        object: 'object',

        // the properties below are optional
        errorHandlingConfig: {
          bucketName: 'bucketName',
          bucketPrefix: 'bucketPrefix',
          failOnFirstError: false,
        },
      },
      redshift: {
        intermediateBucketName: 'intermediateBucketName',
        object: 'object',

        // the properties below are optional
        bucketPrefix: 'bucketPrefix',
        errorHandlingConfig: {
          bucketName: 'bucketName',
          bucketPrefix: 'bucketPrefix',
          failOnFirstError: false,
        },
      },
      s3: {
        bucketName: 'bucketName',

        // the properties below are optional
        bucketPrefix: 'bucketPrefix',
        s3OutputFormatConfig: {
          aggregationConfig: {
            aggregationType: 'aggregationType',
            targetFileSize: 123,
          },
          fileType: 'fileType',
          prefixConfig: {
            pathPrefixHierarchy: ['pathPrefixHierarchy'],
            prefixFormat: 'prefixFormat',
            prefixType: 'prefixType',
          },
          preserveSourceDataTyping: false,
        },
      },
      salesforce: {
        object: 'object',

        // the properties below are optional
        dataTransferApi: 'dataTransferApi',
        errorHandlingConfig: {
          bucketName: 'bucketName',
          bucketPrefix: 'bucketPrefix',
          failOnFirstError: false,
        },
        idFieldNames: ['idFieldNames'],
        writeOperationType: 'writeOperationType',
      },
      sapoData: {
        objectPath: 'objectPath',

        // the properties below are optional
        errorHandlingConfig: {
          bucketName: 'bucketName',
          bucketPrefix: 'bucketPrefix',
          failOnFirstError: false,
        },
        idFieldNames: ['idFieldNames'],
        successResponseHandlingConfig: {
          bucketName: 'bucketName',
          bucketPrefix: 'bucketPrefix',
        },
        writeOperationType: 'writeOperationType',
      },
      snowflake: {
        intermediateBucketName: 'intermediateBucketName',
        object: 'object',

        // the properties below are optional
        bucketPrefix: 'bucketPrefix',
        errorHandlingConfig: {
          bucketName: 'bucketName',
          bucketPrefix: 'bucketPrefix',
          failOnFirstError: false,
        },
      },
      upsolver: {
        bucketName: 'bucketName',
        s3OutputFormatConfig: {
          prefixConfig: {
            pathPrefixHierarchy: ['pathPrefixHierarchy'],
            prefixFormat: 'prefixFormat',
            prefixType: 'prefixType',
          },

          // the properties below are optional
          aggregationConfig: {
            aggregationType: 'aggregationType',
            targetFileSize: 123,
          },
          fileType: 'fileType',
        },

        // the properties below are optional
        bucketPrefix: 'bucketPrefix',
      },
      zendesk: {
        object: 'object',

        // the properties below are optional
        errorHandlingConfig: {
          bucketName: 'bucketName',
          bucketPrefix: 'bucketPrefix',
          failOnFirstError: false,
        },
        idFieldNames: ['idFieldNames'],
        writeOperationType: 'writeOperationType',
      },
    },

    // the properties below are optional
    apiVersion: 'apiVersion',
    connectorProfileName: 'connectorProfileName',
  }],
  flowName: 'flowName',
  sourceFlowConfig: {
    connectorType: 'connectorType',
    sourceConnectorProperties: {
      amplitude: {
        object: 'object',
      },
      customConnector: {
        entityName: 'entityName',

        // the properties below are optional
        customProperties: {
          customPropertiesKey: 'customProperties',
        },
        dataTransferApi: {
          name: 'name',
          type: 'type',
        },
      },
      datadog: {
        object: 'object',
      },
      dynatrace: {
        object: 'object',
      },
      googleAnalytics: {
        object: 'object',
      },
      inforNexus: {
        object: 'object',
      },
      marketo: {
        object: 'object',
      },
      pardot: {
        object: 'object',
      },
      s3: {
        bucketName: 'bucketName',
        bucketPrefix: 'bucketPrefix',

        // the properties below are optional
        s3InputFormatConfig: {
          s3InputFileType: 's3InputFileType',
        },
      },
      salesforce: {
        object: 'object',

        // the properties below are optional
        dataTransferApi: 'dataTransferApi',
        enableDynamicFieldUpdate: false,
        includeDeletedRecords: false,
      },
      sapoData: {
        objectPath: 'objectPath',

        // the properties below are optional
        paginationConfig: {
          maxPageSize: 123,
        },
        parallelismConfig: {
          maxParallelism: 123,
        },
      },
      serviceNow: {
        object: 'object',
      },
      singular: {
        object: 'object',
      },
      slack: {
        object: 'object',
      },
      trendmicro: {
        object: 'object',
      },
      veeva: {
        object: 'object',

        // the properties below are optional
        documentType: 'documentType',
        includeAllVersions: false,
        includeRenditions: false,
        includeSourceFiles: false,
      },
      zendesk: {
        object: 'object',
      },
    },

    // the properties below are optional
    apiVersion: 'apiVersion',
    connectorProfileName: 'connectorProfileName',
    incrementalPullConfig: {
      datetimeTypeFieldName: 'datetimeTypeFieldName',
    },
  },
  tasks: [{
    sourceFields: ['sourceFields'],
    taskType: 'taskType',

    // the properties below are optional
    connectorOperator: {
      amplitude: 'amplitude',
      customConnector: 'customConnector',
      datadog: 'datadog',
      dynatrace: 'dynatrace',
      googleAnalytics: 'googleAnalytics',
      inforNexus: 'inforNexus',
      marketo: 'marketo',
      pardot: 'pardot',
      s3: 's3',
      salesforce: 'salesforce',
      sapoData: 'sapoData',
      serviceNow: 'serviceNow',
      singular: 'singular',
      slack: 'slack',
      trendmicro: 'trendmicro',
      veeva: 'veeva',
      zendesk: 'zendesk',
    },
    destinationField: 'destinationField',
    taskProperties: [{
      key: 'key',
      value: 'value',
    }],
  }],
  triggerConfig: {
    triggerType: 'triggerType',

    // the properties below are optional
    triggerProperties: {
      scheduleExpression: 'scheduleExpression',

      // the properties below are optional
      dataPullMode: 'dataPullMode',
      firstExecutionFrom: 123,
      flowErrorDeactivationThreshold: 123,
      scheduleEndTime: 123,
      scheduleOffset: 123,
      scheduleStartTime: 123,
      timeZone: 'timeZone',
    },
  },

  // the properties below are optional
  description: 'description',
  flowStatus: 'flowStatus',
  kmsArn: 'kmsArn',
  metadataCatalogConfig: {
    glueDataCatalog: {
      databaseName: 'databaseName',
      roleArn: 'roleArn',
      tablePrefix: 'tablePrefix',
    },
  },
  tags: [{
    key: 'key',
    value: 'value',
  }],
});
```

## Initializer

```ts
new CfnFlow(scope: Construct, id: string, props: CfnFlowProps)
```

## Construct Props

- `description`: string — A user-entered description of the flow.

- `destinationFlowConfigList`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnFlow.DestinationFlowConfigProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_appflow.CfnFlow.DestinationFlowConfigProperty.html)[] (required) — The configuration that controls how Amazon AppFlow places data in the destination connector.

- `flowName`: string (required) — The specified name of the flow.

  Spaces are not allowed. Use underscores (_) or hyphens (-) only.

- `flowStatus`: string — Sets the status of the flow. You can specify one of the following values:.

  - **Active** - The flow runs based on the trigger settings that you defined. Active scheduled flows run as scheduled, and active event-triggered flows run when the specified change event occurs. However, active on-demand flows run only when you manually start them by using Amazon AppFlow.
  - **Suspended** - You can use this option to deactivate an active flow. Scheduled and event-triggered flows will cease to run until you reactive them. This value only affects scheduled and event-triggered flows. It has no effect for on-demand flows.

  If you omit the FlowStatus parameter, Amazon AppFlow creates the flow with a default status. The default status for on-demand flows is Active. The default status for scheduled and event-triggered flows is Draft, which means they’re not yet active.

- `kmsArn`: string | [IKeyRef](/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_kms.IKeyRef.html) — 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`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnFlow.MetadataCatalogConfigProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_appflow.CfnFlow.MetadataCatalogConfigProperty.html) — Specifies the configuration that Amazon AppFlow uses when it catalogs your data.

  When Amazon AppFlow catalogs your data, it stores metadata in a data catalog.

- `sourceFlowConfig`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnFlow.SourceFlowConfigProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_appflow.CfnFlow.SourceFlowConfigProperty.html) (required) — Contains information about the configuration of the source connector used in the flow.

- `tags`: [CfnTag](/cdk/api/v2/docs/aws-cdk-lib.CfnTag.html)[] — The tags used to organize, track, or control access for your flow.

- `tasks`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnFlow.TaskProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_appflow.CfnFlow.TaskProperty.html)[] (required) — A list of tasks that Amazon AppFlow performs while transferring the data in the flow run.

- `triggerConfig`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnFlow.TriggerConfigProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_appflow.CfnFlow.TriggerConfigProperty.html) (required) — The trigger settings that determine how and when Amazon AppFlow runs the specified flow.

## Properties

- `attrFlowArn`: string — The flow's Amazon Resource Name (ARN).

- `CFN_RESOURCE_TYPE_NAME`: string (static) — The CloudFormation resource type name for this resource class.

- `cfnOptions`: [ICfnResourceOptions](/cdk/api/v2/docs/aws-cdk-lib.ICfnResourceOptions.html) — Options for this resource, such as condition, update policy etc.

- `cfnResourceType`: string — AWS resource type.

- `creationStack`: string[]

- `description`: string — A user-entered description of the flow.

- `destinationFlowConfigList`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnFlow.DestinationFlowConfigProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_appflow.CfnFlow.DestinationFlowConfigProperty.html)[] — The configuration that controls how Amazon AppFlow places data in the destination connector.

- `env`: [ResourceEnvironment](/cdk/api/v2/docs/aws-cdk-lib.interfaces.ResourceEnvironment.html)

- `flowName`: string — The specified name of the flow.

- `flowRef`: [FlowReference](/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_appflow.FlowReference.html) — A reference to a Flow resource.

- `flowStatus`: string — Sets the status of the flow.

  You can specify one of the following values:.

- `kmsArn`: string — The ARN (Amazon Resource Name) of the Key Management Service (KMS) key you provide for encryption.

- `logicalId`: string — The logical ID for this CloudFormation stack element.

  The logical ID of the element
  is calculated from the path of the resource node in the construct tree.

  To override this value, use `overrideLogicalId(newLogicalId)`.

- `metadataCatalogConfig`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnFlow.MetadataCatalogConfigProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_appflow.CfnFlow.MetadataCatalogConfigProperty.html) — Specifies the configuration that Amazon AppFlow uses when it catalogs your data.

- `node`: [Node](/cdk/api/v2/docs/constructs.Node.html) — The tree node.

- `ref`: string — Return a string that will be resolved to a CloudFormation `{ Ref }` for this element.

  If, by any chance, the intrinsic reference of a resource is not a string, you could
  coerce it to an IResolvable through `Lazy.any({ produce: resource.ref })`.

- `sourceFlowConfig`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnFlow.SourceFlowConfigProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_appflow.CfnFlow.SourceFlowConfigProperty.html) — Contains information about the configuration of the source connector used in the flow.

- `stack`: [Stack](/cdk/api/v2/docs/aws-cdk-lib.Stack.html) — The stack in which this element is defined.

  CfnElements must be defined within a stack scope (directly or indirectly).

- `tags`: [TagManager](/cdk/api/v2/docs/aws-cdk-lib.TagManager.html) — Tag Manager which manages the tags for this resource.

- `tagsRaw`: [CfnTag](/cdk/api/v2/docs/aws-cdk-lib.CfnTag.html)[] — The tags used to organize, track, or control access for your flow.

- `tasks`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnFlow.TaskProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_appflow.CfnFlow.TaskProperty.html)[] — A list of tasks that Amazon AppFlow performs while transferring the data in the flow run.

- `triggerConfig`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnFlow.TriggerConfigProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_appflow.CfnFlow.TriggerConfigProperty.html) — The trigger settings that determine how and when Amazon AppFlow runs the specified flow.

## Methods

- `addDeletionOverride(path: string): void` — Syntactic sugar for `addOverride(path, undefined)`.

  **Parameters**

  - `path` — The path of the value to delete.

- `addDependency(target: CfnResource): void` — Use `addResourceDependency` instead.

  This method has been renamed to `addResourceDependency` to more clearly
  set it apart from `construct.node.addDependency`. See the documentation
  of that function for more details.

- `addDependsOn(target: CfnResource): void` — Use `addResourceDependency` instead.

  This can be used for resources across stacks (or nested stack) boundaries
  and the dependency will automatically be transferred to the relevant scope.

  This method has been renamed to `addResourceDependency`, which makes it
  more clear that this method operates at a different level from the
  construct-level `construct.node.addDependency()` mechanism.

- `addMetadata(key: string, value: any): void` — Add a value to the CloudFormation Resource Metadata.

- `addOverride(path: string, value: any): void` — Adds an override to the synthesized CloudFormation resource.

  To add a
  property override, either use `addPropertyOverride` or prefix `path` with
  "Properties." (i.e. `Properties.TopicName`).

  If the override is nested, separate each nested level using a dot (.) in the path parameter.
  If there is an array as part of the nesting, specify the index in the path.

  To include a literal `.` in the property name, prefix with a `\`. In most
  programming languages you will need to write this as `"\\."` because the
  `\` itself will need to be escaped.

  For example,
  ```typescript
  cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']);
  cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE');
  ```
  would add the overrides
  ```json
  "Properties": {
    "GlobalSecondaryIndexes": [
      {
        "Projection": {
          "NonKeyAttributes": [ "myattribute" ]
          ...
        }
        ...
      },
      {
        "ProjectionType": "INCLUDE"
        ...
      },
    ]
    ...
  }
  ```

  The `value` argument to `addOverride` will not be processed or translated
  in any way. Pass raw JSON values in here with the correct capitalization
  for CloudFormation. If you pass CDK classes or structs, they will be
  rendered with lowercased key names, and CloudFormation will reject the
  template.

  **Parameters**

  - `path` — - The path of the property, you can use dot notation to override values in complex types.
  - `value` — - The value.

- `addPropertyDeletionOverride(propertyPath: string): void` — Adds an override that deletes the value of a property from the resource definition.

  **Parameters**

  - `propertyPath` — The path to the property.

- `addPropertyOverride(propertyPath: string, value: any): void` — Adds an override to a resource property.

  Syntactic sugar for `addOverride("Properties.<...>", value)`.

  **Parameters**

  - `propertyPath` — The path of the property.
  - `value` — The value.

- `addResourceDependency(target: CfnResource, reason?: string): void` — Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.

  This can be used for resources across stacks (or nested stack) boundaries
  and the dependency will automatically be transferred to the relevant scope.

  This method only adds dependencies between L1 resources. If you are
  looking for a generic construct-to-construct dependency mechanism that works
  for all constructs including L2s, use `construct.node.addDependency` instead.

- `applyCrossStackReferenceStrength(strength: ReferenceStrength): void` — Sets the cross-stack reference strength for this resource.

  When set, any cross-stack reference to this resource will use the specified
  strength instead of the global default from the consuming stack's context.

  **Parameters**

  - `strength` — - The reference strength to use for this resource.

- `applyRemovalPolicy(policy?: RemovalPolicy, options?: RemovalPolicyOptions): void` — Sets the deletion policy of the resource based on the removal policy specified.

  The Removal Policy controls what happens to this resource when it stops
  being managed by CloudFormation, either because you've removed it from the
  CDK application or because you've made a change that requires the resource
  to be replaced.

  The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
  account for data recovery and cleanup later (`RemovalPolicy.RETAIN`). In some
  cases, a snapshot can be taken of the resource prior to deletion
  (`RemovalPolicy.SNAPSHOT`). A list of resources that support this policy
  can be found in the following link:

- `arnForFlow(resource: IFlowRef): string` (static)

- `cfnPropertyName(cdkPropertyName: string): string`

- `fromFlowArn(scope: Construct, id: string, arn: string): IFlowRef` (static) — Creates a new IFlowRef from an ARN.

- `fromFlowName(scope: Construct, id: string, flowName: string): IFlowRef` (static) — Creates a new IFlowRef from a flowName.

- `getAtt(attributeName: string, typeHint?: ResolutionTypeHint): Reference` — Returns a token for an runtime attribute of this resource.

  Ideally, use generated attribute accessors (e.g. `resource.arn`), but this can be used for future compatibility
  in case there is no generated attribute.

  **Parameters**

  - `attributeName` — The name of the attribute.

- `getMetadata(key: string): any` — Retrieve a value value from the CloudFormation Resource Metadata.

- `inspect(inspector: TreeInspector): void` — Examines the CloudFormation resource and discloses attributes.

  **Parameters**

  - `inspector` — tree inspector to collect and process attributes.

- `isCfnElement(x: any): boolean` (static) — Returns `true` if a construct is a stack element (i.e. part of the synthesized cloudformation template).

  Uses duck-typing instead of `instanceof` to allow stack elements from different
  versions of this library to be included in the same stack.

  **Returns:** The construct as a stack element or undefined if it is not a stack element.

- `isCfnFlow(x: any): boolean` (static) — Checks whether the given object is a CfnFlow.

- `isCfnResource(x: any): boolean` (static) — Check whether the given object is a CfnResource.

- `isConstruct(x: any): boolean` (static) — Checks if `x` is a construct.

  Use this method instead of `instanceof` to properly detect `Construct`
  instances, even when the construct library is symlinked.

  Explanation: in JavaScript, multiple copies of the `constructs` library on
  disk are seen as independent, completely different libraries. As a
  consequence, the class `Construct` in each copy of the `constructs` library
  is seen as a different class, and an instance of one class will not test as
  `instanceof` the other class. `npm install` will not create installations
  like this, but users may manually symlink construct libraries together or
  use a monorepo tool: in those cases, multiple copies of the `constructs`
  library can be accidentally installed, and `instanceof` will behave
  unpredictably. It is safest to avoid using `instanceof`, and using
  this type-testing method instead.

  **Parameters**

  - `x` — Any object.

  **Returns:** true if `x` is an object created from a class which extends `Construct`.

- `obtainDependencies(): Stack | CfnResource[]` — Retrieves an array of resources and stacks this resource depends on.

  For resources depended on directly, returns the `CfnResource` object. For
  dependencies on other stacks, returns the `Stack` object. The order of the
  array is not guaranteed.

- `overrideLogicalId(newLogicalId: string): void` — Overrides the auto-generated logical ID with a specific ID.

  **Parameters**

  - `newLogicalId` — The new logical ID to use for this stack element.

- `removeDependency(target: CfnResource): void` — Use `removeResourceDependency` instead

  This can be used for resources across stacks (including nested stacks)
  and the dependency will automatically be removed from the relevant scope.

- `removeResourceDependency(target: CfnResource): void` — Indicates that this resource no longer depends on another resource.

  This can be used for resources across stacks (including nested stacks)
  and the dependency will automatically be removed from the relevant scope.

- `replaceDependency(target: CfnResource, newTarget: CfnResource): void` — Replaces one dependency with another.

  **Parameters**

  - `target` — The dependency to replace.
  - `newTarget` — The new dependency to add.

- `toString(): string` — Returns a string representation of this construct.

  **Returns:** a string representation of this resource

- `with(...mixins: IMixin[]): IConstruct` — Applies one or more mixins to this construct.

  Mixins are applied in order. The list of constructs is captured at the
  start of the call, so constructs added by a mixin will not be visited.
  Use multiple `with()` calls if subsequent mixins should apply to added
  constructs.
