Skip to content

create_contact_flow

create_contact_flow(
    instance_id: InstanceId,
    name: ContactFlowName,
    type: ContactFlowType,
    content: ContactFlowContent,
    *,
    config_overrides: Optional[ConnectClientConfig] = None,
    description: Optional[ContactFlowDescription] = None,
    status: Optional[ContactFlowStatus] = None,
    tags: Optional[TagMap] = None,
) -> CreateContactFlowResponse

Creates a flow for the specified Connect Customer instance.

You can also create and update flows using the Connect Customer Flow language.

Parameters:

  • instance_id (InstanceId) –

    The identifier of the Connect Customer instance.

  • name (ContactFlowName) –

    The name of the flow.

  • type (ContactFlowType) –

    The type of the flow. For descriptions of the available types, see Choose a flow type in the Connect Customer Administrator Guide.

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

    The description of the flow.

  • content (ContactFlowContent) –

    The JSON string that represents the content of the flow. For an example, see Example flow in Connect Customer Flow language.

    Length Constraints: Minimum length of 1. Maximum length of 256000.

  • status (Optional[ContactFlowStatus], default: None ) –

    Indicates the flow status as either SAVED or PUBLISHED. The PUBLISHED status will initiate validation on the content. the SAVED status does not initiate validation of the content. SAVED | PUBLISHED.

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

    The tags used to organize, track, or control access for this resource. For example, { "Tags": {"key1":"value1", "key2":"value2"} }.

Raises:

Source code in docs_src/capo_connect/_services/connect.py
def create_contact_flow(
    self,
    instance_id: "capo_connect.types.instance_id.InstanceId",
    name: "capo_connect.types.contact_flow_name.ContactFlowName",
    type: "capo_connect.types.contact_flow_type.ContactFlowType",
    content: "capo_connect.types.contact_flow_content.ContactFlowContent",
    *,
    config_overrides: Optional[ConnectClientConfig] = None,
    description: Optional[
        "capo_connect.types.contact_flow_description.ContactFlowDescription"
    ] = None,
    status: Optional[
        "capo_connect.types.contact_flow_status.ContactFlowStatus"
    ] = None,
    tags: Optional["capo_connect.types.tag_map.TagMap"] = None,
) -> "capo_connect.types.create_contact_flow_response.CreateContactFlowResponse":
    """<p>Creates a flow for the specified Connect Customer instance.</p> <p>You can also create and update flows using the <a href="https://docs.aws.amazon.com/connect/latest/APIReference/flow-language.html">Connect Customer Flow language</a>.</p>

    Args:
        instance_id: <p>The identifier of the Connect Customer instance.</p>
        name: <p>The name of the flow.</p>
        type: <p>The type of the flow. For descriptions of the available types, see <a href="https://docs.aws.amazon.com/connect/latest/adminguide/create-contact-flow.html#contact-flow-types">Choose a flow type</a> in the <i>Connect Customer Administrator Guide</i>.</p>
        description: <p>The description of the flow. </p>
        content: <p>The JSON string that represents the content of the flow. For an example, see <a href="https://docs.aws.amazon.com/connect/latest/APIReference/flow-language-example.html">Example flow in Connect Customer Flow language</a>. </p> <p>Length Constraints: Minimum length of 1. Maximum length of 256000.</p>
        status: <p>Indicates the flow status as either <code>SAVED</code> or <code>PUBLISHED</code>. The <code>PUBLISHED</code> status will initiate validation on the content. the <code>SAVED</code> status does not initiate validation of the content. <code>SAVED</code> | <code>PUBLISHED</code>.</p>
        tags: <p>The tags used to organize, track, or control access for this resource. For example, { "Tags": {"key1":"value1", "key2":"value2"} }.</p>

    Raises:
        capo_connect.errors.duplicate_resource_exception.DuplicateResourceException: <p>A resource with the specified name already exists.</p>
        capo_connect.errors.internal_service_exception.InternalServiceException: <p>Request processing failed because of an error or failure with the service.</p>
        capo_connect.errors.invalid_contact_flow_exception.InvalidContactFlowException: <p>The flow is not valid.</p>
        capo_connect.errors.invalid_parameter_exception.InvalidParameterException: <p>One or more of the specified parameters are not valid.</p>
        capo_connect.errors.invalid_request_exception.InvalidRequestException: <p>The request is not valid.</p>
        capo_connect.errors.limit_exceeded_exception.LimitExceededException: <p>The allowed limit for the resource has been exceeded.</p>
        capo_connect.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource was not found.</p>
        capo_connect.errors.throttling_exception.ThrottlingException: <p>The throttling limit has been exceeded.</p>
        capo_connect.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_connect.types.create_contact_flow_request.CreateContactFlowRequest]",
    ) -> OperationResponse[
        "capo_connect.types.create_contact_flow_response.CreateContactFlowResponse"
    ]:
        import capo_connect._operations.amazon_connect_service.create_contact_flow

        output, http_response = (
            capo_connect._operations.amazon_connect_service.create_contact_flow.create_contact_flow(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateContactFlow")
    )
    input_: capo_connect.types.create_contact_flow_request.CreateContactFlowRequest = {
        "instance_id": instance_id,
        "name": name,
        "type": type,
        "content": content,
    }
    if description is not None:
        input_["description"] = description
    if status is not None:
        input_["status"] = status
    if tags is not None:
        input_["tags"] = tags

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output