Skip to content

create_workflow_run

create_workflow_run(
    workflow_definition_name: WorkflowDefinitionName,
    model_id: ModelId,
    client_info: ClientInfo,
    *,
    config_overrides: Optional[NovaActClientConfig] = None,
    client_token: Optional[ClientToken] = None,
    log_group_name: Optional[CloudWatchLogGroupName] = None,
) -> CreateWorkflowRunResponse

Creates a new execution instance of a workflow definition with specified parameters.

Parameters:

  • workflow_definition_name (WorkflowDefinitionName) –

    The name of the workflow definition to execute.

  • model_id (ModelId) –

    The ID of the AI model to use for workflow execution.

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

    A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.

  • log_group_name (Optional[CloudWatchLogGroupName], default: None ) –

    The CloudWatch log group name for storing workflow execution logs.

  • client_info (ClientInfo) –

    Information about the client making the request, including compatibility version and SDK version.

Raises:

Source code in docs_src/capo_nova_act/_services/nova_act.py
def create_workflow_run(
    self,
    workflow_definition_name: "capo_nova_act.types.workflow_definition_name.WorkflowDefinitionName",
    model_id: "capo_nova_act.types.model_id.ModelId",
    client_info: "capo_nova_act.types.client_info.ClientInfo",
    *,
    config_overrides: Optional[NovaActClientConfig] = None,
    client_token: Optional["capo_nova_act.types.client_token.ClientToken"] = None,
    log_group_name: Optional[
        "capo_nova_act.types.cloud_watch_log_group_name.CloudWatchLogGroupName"
    ] = None,
) -> "capo_nova_act.types.create_workflow_run_response.CreateWorkflowRunResponse":
    """<p>Creates a new execution instance of a workflow definition with specified parameters.</p>

    Args:
        workflow_definition_name: <p>The name of the workflow definition to execute.</p>
        model_id: <p>The ID of the AI model to use for workflow execution.</p>
        client_token: <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.</p>
        log_group_name: <p>The CloudWatch log group name for storing workflow execution logs.</p>
        client_info: <p>Information about the client making the request, including compatibility version and SDK version.</p>

    Raises:
        capo_nova_act.errors.access_denied_exception.AccessDeniedException: <p>You don't have sufficient permissions to perform this action.</p>
        capo_nova_act.errors.conflict_exception.ConflictException: <p>The request could not be completed due to a conflict with the current state of the resource.</p>
        capo_nova_act.errors.internal_server_exception.InternalServerException: <p>An internal server error occurred. Please try again later.</p>
        capo_nova_act.errors.resource_not_found_exception.ResourceNotFoundException: <p>The requested resource was not found.</p>
        capo_nova_act.errors.throttling_exception.ThrottlingException: <p>The request was throttled due to too many requests. Please try again later.</p>
        capo_nova_act.errors.validation_exception.ValidationException: <p>The input parameters for the request are invalid.</p>
        capo_nova_act.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_nova_act.types.create_workflow_run_request.CreateWorkflowRunRequest]",
    ) -> OperationResponse[
        "capo_nova_act.types.create_workflow_run_response.CreateWorkflowRunResponse"
    ]:
        import capo_nova_act._operations.amazon_nova_agents_data_plane.create_workflow_run

        output, http_response = (
            capo_nova_act._operations.amazon_nova_agents_data_plane.create_workflow_run.create_workflow_run(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateWorkflowRun")
    )
    input_: capo_nova_act.types.create_workflow_run_request.CreateWorkflowRunRequest = {
        "workflow_definition_name": workflow_definition_name,
        "model_id": model_id,
        "client_info": client_info,
    }
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token
    if log_group_name is not None:
        input_["log_group_name"] = log_group_name

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