Skip to content

start_workflow_run

start_workflow_run(
    workflow_arn: WorkflowArn,
    *,
    config_overrides: Optional[MWAAServerlessClientConfig] = None,
    client_token: Optional[IdempotencyTokenString] = None,
    override_parameters: Optional[ObjectMap] = None,
    workflow_version: Optional[VersionId] = None,
) -> StartWorkflowRunResponse

Starts a new execution of a workflow. This operation creates a workflow run that executes the tasks that are defined in the workflow. Amazon Managed Workflows for Apache Airflow Serverless schedules the workflow execution across its managed Airflow environment, automatically scaling ECS worker tasks based on the workload. The service handles task isolation, dependency resolution, and provides comprehensive monitoring and logging throughout the execution lifecycle.

Parameters:

  • workflow_arn (WorkflowArn) –

    The Amazon Resource Name (ARN) of the workflow you want to run.

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

    A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. This token prevents duplicate workflow run requests.

  • override_parameters (Optional[ObjectMap], default: None ) –

    Optional parameters to override default workflow parameters for this specific run. These parameters are passed to the workflow during execution and can be used to customize behavior without modifying the workflow definition. Parameters are made available as environment variables to tasks and you can reference them within the YAML workflow definition using standard parameter substitution syntax.

  • workflow_version (Optional[VersionId], default: None ) –

    Optional. The specific version of the workflow to execute. If not specified, the latest version is used.

Raises:

  • AccessDeniedException –

    You do not have sufficient permission to perform this action.

  • ConflictException –

    You cannot create a resource that already exists, or the resource is in a state that prevents the requested operation.

  • InternalServerException –

    An unexpected server-side error occurred during request processing.

  • OperationTimeoutException –

    The operation timed out.

  • ResourceNotFoundException –

    The specified resource was not found. You can only access or modify a resource that already exists.

  • ServiceQuotaExceededException –

    The request exceeds the service quota for Amazon Managed Workflows for Apache Airflow Serverless resources. This can occur when you attempt to create more workflows than allowed, exceed concurrent workflow run limits, or surpass task execution limits. Amazon Managed Workflows for Apache Airflow Serverless implements admission control using DynamoDB-based counters to manage resource utilization across the multi-tenant environment. Contact Amazon Web Services Support to request quota increases if you need higher limits for your use case.

  • ThrottlingException –

    The request was denied because too many requests were made in a short period, exceeding the service rate limits. Amazon Managed Workflows for Apache Airflow Serverless implements throttling controls to ensure fair resource allocation across all customers in the multi-tenant environment. This helps maintain service stability and performance. If you encounter throttling, implement exponential backoff and retry logic in your applications, or consider distributing your API calls over a longer time period.

  • ValidationException –

    The specified request parameters are invalid, missing, or inconsistent with Amazon Managed Workflows for Apache Airflow Serverless service requirements. This can occur when workflow definitions contain unsupported operators, when required IAM permissions are missing, when S3 locations are inaccessible, or when network configurations are invalid. The service validates workflow definitions, execution roles, and resource configurations to ensure compatibility with the managed Airflow environment and security requirements.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_mwaa_serverless/_services/mwaa_serverless.py
def start_workflow_run(
    self,
    workflow_arn: "capo_mwaa_serverless.types.workflow_arn.WorkflowArn",
    *,
    config_overrides: Optional[MWAAServerlessClientConfig] = None,
    client_token: Optional[
        "capo_mwaa_serverless.types.idempotency_token_string.IdempotencyTokenString"
    ] = None,
    override_parameters: Optional[
        "capo_mwaa_serverless.types.object_map.ObjectMap"
    ] = None,
    workflow_version: Optional[
        "capo_mwaa_serverless.types.version_id.VersionId"
    ] = None,
) -> "capo_mwaa_serverless.types.start_workflow_run_response.StartWorkflowRunResponse":
    """<p>Starts a new execution of a workflow. This operation creates a workflow run that executes the tasks that are defined in the workflow. Amazon Managed Workflows for Apache Airflow Serverless schedules the workflow execution across its managed Airflow environment, automatically scaling ECS worker tasks based on the workload. The service handles task isolation, dependency resolution, and provides comprehensive monitoring and logging throughout the execution lifecycle.</p>

    Args:
        workflow_arn: <p>The Amazon Resource Name (ARN) of the workflow you want to run.</p>
        client_token: <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. This token prevents duplicate workflow run requests.</p>
        override_parameters: <p>Optional parameters to override default workflow parameters for this specific run. These parameters are passed to the workflow during execution and can be used to customize behavior without modifying the workflow definition. Parameters are made available as environment variables to tasks and you can reference them within the YAML workflow definition using standard parameter substitution syntax.</p>
        workflow_version: <p>Optional. The specific version of the workflow to execute. If not specified, the latest version is used.</p>

    Raises:
        capo_mwaa_serverless.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient permission to perform this action.</p>
        capo_mwaa_serverless.errors.conflict_exception.ConflictException: <p>You cannot create a resource that already exists, or the resource is in a state that prevents the requested operation.</p>
        capo_mwaa_serverless.errors.internal_server_exception.InternalServerException: <p>An unexpected server-side error occurred during request processing.</p>
        capo_mwaa_serverless.errors.operation_timeout_exception.OperationTimeoutException: <p>The operation timed out.</p>
        capo_mwaa_serverless.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource was not found. You can only access or modify a resource that already exists.</p>
        capo_mwaa_serverless.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The request exceeds the service quota for Amazon Managed Workflows for Apache Airflow Serverless resources. This can occur when you attempt to create more workflows than allowed, exceed concurrent workflow run limits, or surpass task execution limits. Amazon Managed Workflows for Apache Airflow Serverless implements admission control using DynamoDB-based counters to manage resource utilization across the multi-tenant environment. Contact Amazon Web Services Support to request quota increases if you need higher limits for your use case.</p>
        capo_mwaa_serverless.errors.throttling_exception.ThrottlingException: <p>The request was denied because too many requests were made in a short period, exceeding the service rate limits. Amazon Managed Workflows for Apache Airflow Serverless implements throttling controls to ensure fair resource allocation across all customers in the multi-tenant environment. This helps maintain service stability and performance. If you encounter throttling, implement exponential backoff and retry logic in your applications, or consider distributing your API calls over a longer time period.</p>
        capo_mwaa_serverless.errors.validation_exception.ValidationException: <p>The specified request parameters are invalid, missing, or inconsistent with Amazon Managed Workflows for Apache Airflow Serverless service requirements. This can occur when workflow definitions contain unsupported operators, when required IAM permissions are missing, when S3 locations are inaccessible, or when network configurations are invalid. The service validates workflow definitions, execution roles, and resource configurations to ensure compatibility with the managed Airflow environment and security requirements.</p>
        capo_mwaa_serverless.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_mwaa_serverless.types.start_workflow_run_request.StartWorkflowRunRequest]",
    ) -> OperationResponse[
        "capo_mwaa_serverless.types.start_workflow_run_response.StartWorkflowRunResponse"
    ]:
        import capo_mwaa_serverless._operations.amazon_mwaa_serverless.start_workflow_run

        output, http_response = (
            capo_mwaa_serverless._operations.amazon_mwaa_serverless.start_workflow_run.start_workflow_run(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_mwaa_serverless.types.start_workflow_run_request.StartWorkflowRunRequest",
    ) -> dict[str, Any]:
        import capo_mwaa_serverless.types.start_workflow_run_request

        return (
            capo_mwaa_serverless.types.start_workflow_run_request.redact_sensitive(
                input_
            )
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("StartWorkflowRun", redact_input=_redact_input),
    )
    input_: capo_mwaa_serverless.types.start_workflow_run_request.StartWorkflowRunRequest = {
        "workflow_arn": workflow_arn
    }
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token
    if override_parameters is not None:
        input_["override_parameters"] = override_parameters
    if workflow_version is not None:
        input_["workflow_version"] = workflow_version

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