Skip to content

create_flow async

create_flow(
    flow_name: FlowName,
    trigger_config: TriggerConfig,
    source_flow_config: SourceFlowConfig,
    destination_flow_config_list: DestinationFlowConfigList,
    tasks: Tasks,
    *,
    config_overrides: Optional[AsyncAppflowClientConfig] = None,
    description: Optional[FlowDescription] = None,
    kms_arn: Optional[KMSArn] = None,
    tags: Optional[TagMap] = None,
    metadata_catalog_config: Optional[MetadataCatalogConfig] = None,
    client_token: Optional[ClientToken] = None,
) -> CreateFlowResponse

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.

Parameters:

  • flow_name (FlowName) –

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

  • description (Optional[FlowDescription], default: None ) –

    A description of the flow you want to create.

  • kms_arn (Optional[KMSArn], default: None ) –

    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.

  • trigger_config (TriggerConfig) –

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

  • source_flow_config (SourceFlowConfig) –

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

  • destination_flow_config_list (DestinationFlowConfigList) –

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

  • tasks (Tasks) –

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

  • tags (Optional[TagMap], default: None ) –

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

  • metadata_catalog_config (Optional[MetadataCatalogConfig], default: None ) –

    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.

  • client_token (Optional[ClientToken], default: None ) –

    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.

Raises:

Source code in docs_src/capo_appflow/_services/async_appflow.py
async def create_flow(
    self,
    flow_name: "capo_appflow.types.flow_name.FlowName",
    trigger_config: "capo_appflow.types.trigger_config.TriggerConfig",
    source_flow_config: "capo_appflow.types.source_flow_config.SourceFlowConfig",
    destination_flow_config_list: "capo_appflow.types.destination_flow_config_list.DestinationFlowConfigList",
    tasks: "capo_appflow.types.tasks.Tasks",
    *,
    config_overrides: Optional[AsyncAppflowClientConfig] = None,
    description: Optional[
        "capo_appflow.types.flow_description.FlowDescription"
    ] = None,
    kms_arn: Optional["capo_appflow.types.kms_arn.KMSArn"] = None,
    tags: Optional["capo_appflow.types.tag_map.TagMap"] = None,
    metadata_catalog_config: Optional[
        "capo_appflow.types.metadata_catalog_config.MetadataCatalogConfig"
    ] = None,
    client_token: Optional["capo_appflow.types.client_token.ClientToken"] = None,
) -> "capo_appflow.types.create_flow_response.CreateFlowResponse":
    """<p> 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. </p>

    Args:
        flow_name: <p> The specified name of the flow. Spaces are not allowed. Use underscores (_) or hyphens (-) only. </p>
        description: <p> A description of the flow you want to create. </p>
        kms_arn: <p> 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. </p>
        trigger_config: <p> The trigger settings that determine how and when the flow runs. </p>
        source_flow_config: <p> The configuration that controls how Amazon AppFlow retrieves data from the source connector. </p>
        destination_flow_config_list: <p> The configuration that controls how Amazon AppFlow places data in the destination connector. </p>
        tasks: <p> A list of tasks that Amazon AppFlow performs while transferring the data in the flow run. </p>
        tags: <p> The tags used to organize, track, or control access for your flow. </p>
        metadata_catalog_config: <p>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.</p>
        client_token: <p>The <code>clientToken</code> parameter is an idempotency token. It ensures that your <code>CreateFlow</code> 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 <code>clientToken</code> parameter value.</p> <p>If you omit a <code>clientToken</code> 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.</p> <p>If you specify input parameters that differ from your first request, an error occurs. If you use a different value for <code>clientToken</code>, Amazon AppFlow considers it a new call to <code>CreateFlow</code>. The token is active for 8 hours.</p>

    Raises:
        capo_appflow.errors.access_denied_exception.AccessDeniedException: <p>AppFlow/Requester has invalid or missing permissions.</p>
        capo_appflow.errors.conflict_exception.ConflictException: <p> 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. </p>
        capo_appflow.errors.connector_authentication_exception.ConnectorAuthenticationException: <p> An error occurred when authenticating with the connector endpoint. </p>
        capo_appflow.errors.connector_server_exception.ConnectorServerException: <p> An error occurred when retrieving data from the connector endpoint. </p>
        capo_appflow.errors.internal_server_exception.InternalServerException: <p> An internal service error occurred during the processing of your request. Try again later. </p>
        capo_appflow.errors.resource_not_found_exception.ResourceNotFoundException: <p> The resource specified in the request (such as the source or destination connector profile) is not found. </p>
        capo_appflow.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p> The request would cause a service quota (such as the number of flows) to be exceeded. </p>
        capo_appflow.errors.validation_exception.ValidationException: <p> The request has invalid or missing parameters. </p>
        capo_appflow.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_appflow.types.create_flow_request.CreateFlowRequest]",
    ) -> AsyncOperationResponse[
        "capo_appflow.types.create_flow_response.CreateFlowResponse"
    ]:
        import capo_appflow._operations.sandstone_configuration_service_lambda.create_flow

        (
            output,
            http_response,
        ) = await capo_appflow._operations.sandstone_configuration_service_lambda.create_flow.async_create_flow(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateFlow")
    )
    input_: capo_appflow.types.create_flow_request.CreateFlowRequest = {
        "flow_name": flow_name,
        "trigger_config": trigger_config,
        "source_flow_config": source_flow_config,
        "destination_flow_config_list": destination_flow_config_list,
        "tasks": tasks,
    }
    if description is not None:
        input_["description"] = description
    if kms_arn is not None:
        input_["kms_arn"] = kms_arn
    if tags is not None:
        input_["tags"] = tags
    if metadata_catalog_config is not None:
        input_["metadata_catalog_config"] = metadata_catalog_config
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output