Skip to content

AWS.AppFlow reference

Source: src/AWS/AppFlow/CancelFlowExecutions.ts

Runtime binding for appflow:CancelFlowExecutions.

Bind this operation to a Flow in the function’s init phase to get a callable that cancels in-progress runs of the flow — all active runs when called with no arguments, or only the given executionIds. Executions that cannot be canceled (already finished, unknown) are returned in invalidExecutions. The flow name is injected automatically and appflow:CancelFlowExecutions is granted on the flow. Provide the implementation with Effect.provide(AWS.AppFlow.CancelFlowExecutionsHttp).

// init — bind the operation to the flow
const cancelFlowExecutions = yield* AWS.AppFlow.CancelFlowExecutions(flow);
// runtime — cancel a run by execution id
const result = yield* cancelFlowExecutions({
executionIds: [executionId],
});
// result.invalidExecutions lists ids that could not be canceled

Source: src/AWS/AppFlow/ConnectorProfile.ts

An Amazon AppFlow connector profile. A connector profile stores the connection settings and credentials for a SaaS/data-warehouse connector (Salesforce, Snowflake, Redshift, etc.) so flows can reference it.

Most connectors require vendor credentials obtained through a human-in-the-loop OAuth or API-key step, so a connector profile’s live lifecycle generally cannot be created purely programmatically. S3 and EventBridge flows do not need a connector profile at all.

ConnectorProfile: Creating a Connector Profile

Section titled “ConnectorProfile: Creating a Connector Profile”
const profile = yield* AppFlow.ConnectorProfile("Warehouse", {
connectorProfileName: "warehouse",
connectorType: "Redshift",
connectionMode: "Public",
connectorProfileConfig: {
connectorProfileProperties: {
Redshift: {
databaseUrl: "jdbc:redshift://cluster:5439/db",
bucketName: "appflow-staging",
roleArn: role.roleArn,
},
},
connectorProfileCredentials: {
Redshift: { username: "admin", password: "..." },
},
},
});

Source: src/AWS/AppFlow/DescribeConnectorEntity.ts

Runtime binding for appflow:DescribeConnectorEntity.

Bind this operation to a ConnectorProfile in the function’s init phase to get a callable that describes one entity’s fields (the data model of a Salesforce object, a database table, etc.). The connector profile name is injected automatically and appflow:DescribeConnectorEntity is granted on the profile. Provide the implementation with Effect.provide(AWS.AppFlow.DescribeConnectorEntityHttp).

DescribeConnectorEntity: Discovering Connector Entities

Section titled “DescribeConnectorEntity: Discovering Connector Entities”
// init — bind the operation to the connector profile
const describeConnectorEntity =
yield* AWS.AppFlow.DescribeConnectorEntity(profile);
// runtime — read the entity's field metadata
const result = yield* describeConnectorEntity({
connectorEntityName: "Account",
});
// result.connectorEntityFields lists each field with its type

Source: src/AWS/AppFlow/DescribeFlowExecutionRecords.ts

Runtime binding for appflow:DescribeFlowExecutionRecords.

Bind this operation to a Flow in the function’s init phase to get a callable that pages through the flow’s run history — each record carries the executionId, status, timing, and record counts of one run. The flow name is injected automatically and appflow:DescribeFlowExecutionRecords is granted on the flow. Provide the implementation with Effect.provide(AWS.AppFlow.DescribeFlowExecutionRecordsHttp).

DescribeFlowExecutionRecords: Monitoring Flow Runs

Section titled “DescribeFlowExecutionRecords: Monitoring Flow Runs”
// init — bind the operation to the flow
const describeFlowExecutionRecords =
yield* AWS.AppFlow.DescribeFlowExecutionRecords(flow);
// runtime — read the most recent run
const records = yield* describeFlowExecutionRecords({ maxResults: 1 });
const latest = records.flowExecutions?.[0];
// latest?.executionStatus === "Successful"

Source: src/AWS/AppFlow/Flow.ts

An Amazon AppFlow flow. A flow transfers data between a source connector and one or more destination connectors, applying field-mapping tasks. The credential-free S3-to-S3 path is directly testable; other connectors require a ConnectorProfile with vendor credentials.

For an S3 source, the bucket policy must authorize the appflow.amazonaws.com service principal (s3:GetObject + s3:ListBucket on the source; s3:PutObject and the multipart/ACL actions on the destination), and the source prefix must contain at least one object when the flow is created — AppFlow validates connectivity by listing the source at CreateFlow time and rejects an empty prefix with ConnectorServerException.

const flow = yield* AppFlow.Flow("Copy", {
triggerConfig: { triggerType: "OnDemand" },
sourceFlowConfig: {
connectorType: "S3",
sourceConnectorProperties: {
S3: { bucketName: srcBucket, bucketPrefix: "input" },
},
},
destinationFlowConfigList: [
{
connectorType: "S3",
destinationConnectorProperties: {
S3: { bucketName: dstBucket, bucketPrefix: "output" },
},
},
],
tasks: [
{
taskType: "Map_all",
sourceFields: [],
connectorOperator: { S3: "NO_OP" },
taskProperties: {},
},
],
});

Source: src/AWS/AppFlow/ListConnectorEntities.ts

Runtime binding for appflow:ListConnectorEntities.

Bind this operation to a ConnectorProfile in the function’s init phase to get a callable that discovers the entities the connected application exposes (e.g. Salesforce objects, database tables) — useful for dynamic schema discovery at runtime. The connector profile name is injected automatically and appflow:ListConnectorEntities is granted on the profile. Provide the implementation with Effect.provide(AWS.AppFlow.ListConnectorEntitiesHttp).

ListConnectorEntities: Discovering Connector Entities

Section titled “ListConnectorEntities: Discovering Connector Entities”
// init — bind the operation to the connector profile
const listConnectorEntities =
yield* AWS.AppFlow.ListConnectorEntities(profile);
// runtime — enumerate the connector's entities
const result = yield* listConnectorEntities();
// result.connectorEntityMap groups entities by category

Source: src/AWS/AppFlow/ResetConnectorMetadataCache.ts

Runtime binding for appflow:ResetConnectorMetadataCache.

Bind this operation to a ConnectorProfile in the function’s init phase to get a callable that clears AppFlow’s cached entity metadata for the profile, so the next ListConnectorEntities / DescribeConnectorEntity call fetches fresh metadata from the connected application. The connector profile name is injected automatically and appflow:ResetConnectorMetadataCache is granted on the profile. Provide the implementation with Effect.provide(AWS.AppFlow.ResetConnectorMetadataCacheHttp).

ResetConnectorMetadataCache: Discovering Connector Entities

Section titled “ResetConnectorMetadataCache: Discovering Connector Entities”
// init — bind the operation to the connector profile
const resetConnectorMetadataCache =
yield* AWS.AppFlow.ResetConnectorMetadataCache(profile);
// runtime — drop the cache before re-listing entities
yield* resetConnectorMetadataCache();
const fresh = yield* listConnectorEntities();

Source: src/AWS/AppFlow/StartFlow.ts

Runtime binding for appflow:StartFlow.

Bind this operation to a Flow in the function’s init phase to get a callable that activates the flow — for on-demand flows this triggers a single run and returns its executionId; for schedule and event-triggered flows it activates the flow. The flow name is injected automatically and appflow:StartFlow is granted on the flow. Provide the implementation with Effect.provide(AWS.AppFlow.StartFlowHttp).

export default MyFunction.make(
{ main: import.meta.url, functionUrl: true },
Effect.gen(function* () {
const flow = yield* AWS.AppFlow.Flow("CopyFlow", { ... });
// init — bind the operation to the flow
const startFlow = yield* AWS.AppFlow.StartFlow(flow);
return {
fetch: Effect.gen(function* () {
// runtime — trigger a run
const run = yield* startFlow();
return HttpServerResponse.json({ executionId: run.executionId });
}).pipe(Effect.orDie),
};
}).pipe(Effect.provide(AWS.AppFlow.StartFlowHttp)),
);

Source: src/AWS/AppFlow/StopFlow.ts

Runtime binding for appflow:StopFlow.

Bind this operation to a Flow in the function’s init phase to get a callable that deactivates a schedule or event-triggered flow. On-demand flows cannot be stopped — AppFlow rejects them with a typed UnsupportedOperationException. The flow name is injected automatically and appflow:StopFlow is granted on the flow. Provide the implementation with Effect.provide(AWS.AppFlow.StopFlowHttp).

// init — bind the operation to the flow
const stopFlow = yield* AWS.AppFlow.StopFlow(flow);
// runtime — deactivate the flow
const result = yield* stopFlow();
// result.flowStatus === "Suspended"