Skip to content

create_workflow async

create_workflow(
    name: NameString,
    *,
    config_overrides: Optional[AsyncGlueClientConfig] = None,
    description: Optional[WorkflowDescriptionString] = None,
    default_run_properties: Optional[WorkflowRunProperties] = None,
    tags: Optional[TagsMap] = None,
    max_concurrent_runs: Optional[NullableInteger] = None,
) -> CreateWorkflowResponse

Creates a new workflow.

Parameters:

  • name (NameString) –

    The name to be assigned to the workflow. It should be unique within your account.

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

    A description of the workflow.

  • default_run_properties (Optional[WorkflowRunProperties], default: None ) –

    A collection of properties to be used as part of each execution of the workflow.

    Run properties may be logged. Do not pass plaintext secrets as properties. Retrieve secrets from a Glue Connection, Amazon Web Services Secrets Manager or other secret management mechanism if you intend to use them within the workflow run.

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

    The tags to be used with this workflow.

  • max_concurrent_runs (Optional[NullableInteger], default: None ) –

    You can use this parameter to prevent unwanted multiple updates to data, to control costs, or in some cases, to prevent exceeding the maximum number of concurrent runs of any of the component jobs. If you leave this parameter blank, there is no limit to the number of concurrent workflow runs.

Raises:

Source code in docs_src/capo_glue/_services/async_glue.py
async def create_workflow(
    self,
    name: "capo_glue.types.name_string.NameString",
    *,
    config_overrides: Optional[AsyncGlueClientConfig] = None,
    description: Optional[
        "capo_glue.types.workflow_description_string.WorkflowDescriptionString"
    ] = None,
    default_run_properties: Optional[
        "capo_glue.types.workflow_run_properties.WorkflowRunProperties"
    ] = None,
    tags: Optional["capo_glue.types.tags_map.TagsMap"] = None,
    max_concurrent_runs: Optional[
        "capo_glue.types.nullable_integer.NullableInteger"
    ] = None,
) -> "capo_glue.types.create_workflow_response.CreateWorkflowResponse":
    """<p>Creates a new workflow.</p>

    Args:
        name: <p>The name to be assigned to the workflow. It should be unique within your account.</p>
        description: <p>A description of the workflow.</p>
        default_run_properties: <p>A collection of properties to be used as part of each execution of the workflow.</p> <p>Run properties may be logged. Do not pass plaintext secrets as properties. Retrieve secrets from a Glue Connection, Amazon Web Services Secrets Manager or other secret management mechanism if you intend to use them within the workflow run.</p>
        tags: <p>The tags to be used with this workflow.</p>
        max_concurrent_runs: <p>You can use this parameter to prevent unwanted multiple updates to data, to control costs, or in some cases, to prevent exceeding the maximum number of concurrent runs of any of the component jobs. If you leave this parameter blank, there is no limit to the number of concurrent workflow runs.</p>

    Raises:
        capo_glue.errors.already_exists_exception.AlreadyExistsException: <p>A resource to be created or added already exists.</p>
        capo_glue.errors.concurrent_modification_exception.ConcurrentModificationException: <p>Two processes are trying to modify a resource simultaneously.</p>
        capo_glue.errors.internal_service_exception.InternalServiceException: <p>An internal service error occurred.</p>
        capo_glue.errors.invalid_input_exception.InvalidInputException: <p>The input provided was not valid.</p>
        capo_glue.errors.operation_timeout_exception.OperationTimeoutException: <p>The operation timed out.</p>
        capo_glue.errors.resource_number_limit_exceeded_exception.ResourceNumberLimitExceededException: <p>A resource numerical limit was exceeded.</p>
        capo_glue.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_glue.types.create_workflow_request.CreateWorkflowRequest]",
    ) -> AsyncOperationResponse[
        "capo_glue.types.create_workflow_response.CreateWorkflowResponse"
    ]:
        import capo_glue._operations.aws_glue.create_workflow

        (
            output,
            http_response,
        ) = await capo_glue._operations.aws_glue.create_workflow.async_create_workflow(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateWorkflow")
    )
    input_: capo_glue.types.create_workflow_request.CreateWorkflowRequest = {
        "name": name
    }
    if description is not None:
        input_["description"] = description
    if default_run_properties is not None:
        input_["default_run_properties"] = default_run_properties
    if tags is not None:
        input_["tags"] = tags
    if max_concurrent_runs is not None:
        input_["max_concurrent_runs"] = max_concurrent_runs

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