Skip to content

/AWS1/IF_MWS=>STARTWORKFLOWRUN()

About StartWorkflowRun

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.

Method Signature

METHODS /AWS1/IF_MWS~STARTWORKFLOWRUN
  IMPORTING
    !IV_WORKFLOWARN TYPE /AWS1/MWSWORKFLOWARN OPTIONAL
    !IV_CLIENTTOKEN TYPE /AWS1/MWSIDEMTOKENSTRING OPTIONAL
    !IT_OVERRIDEPARAMETERS TYPE /AWS1/CL_RT_DOCUMENT=>TT_MAP OPTIONAL
    !IV_WORKFLOWVERSION TYPE /AWS1/MWSVERSIONID OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_mwsstrtworkflowrunrsp
  RAISING
    /AWS1/CX_MWSACCESSDENIEDEX
    /AWS1/CX_MWSCONFLICTEXCEPTION
    /AWS1/CX_MWSINTERNALSERVEREX
    /AWS1/CX_MWSOPERATIONTIMEOUTEX
    /AWS1/CX_MWSRESOURCENOTFOUNDEX
    /AWS1/CX_MWSSERVICEQUOTAEXCDEX
    /AWS1/CX_MWSTHROTTLINGEX
    /AWS1/CX_MWSVALIDATIONEX
    /AWS1/CX_MWSCLIENTEXC
    /AWS1/CX_MWSSERVEREXC
    /AWS1/CX_RT_TECHNICAL_GENERIC
    /AWS1/CX_RT_SERVICE_GENERIC.

IMPORTING

Required arguments:

iv_workflowarn TYPE /AWS1/MWSWORKFLOWARN /AWS1/MWSWORKFLOWARN

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

Optional arguments:

iv_clienttoken TYPE /AWS1/MWSIDEMTOKENSTRING /AWS1/MWSIDEMTOKENSTRING

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

it_overrideparameters TYPE /AWS1/CL_RT_DOCUMENT=>TT_MAP TT_MAP

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.

iv_workflowversion TYPE /AWS1/MWSVERSIONID /AWS1/MWSVERSIONID

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

RETURNING

oo_output TYPE REF TO /aws1/cl_mwsstrtworkflowrunrsp /AWS1/CL_MWSSTRTWORKFLOWRUNRSP

Domain /AWS1/RT_ACCOUNT_ID
Primitive Type NUMC

Examples

Syntax Example

This is an example of the syntax for calling the method. It includes every possible argument and initializes every possible value. The data provided is not necessarily semantically accurate (for example the value "string" may be provided for something that is intended to be an instance ID, or in some cases two arguments may be mutually exclusive). The syntax shows the ABAP syntax for creating the various data structures.

DATA(lo_result) = lo_client->startworkflowrun(
  it_overrideparameters = VALUE /aws1/cl_rt_document=>tt_map(
    (
      VALUE /aws1/cl_rt_document=>ts_document_maprow(
        key = |string|
        value = /AWS1/CL_RT_DOCUMENT=>FROM_JSON_STR( |\{"foo":"this is a JSON object..."\}| )
      )
    )
  )
  iv_clienttoken = |string|
  iv_workflowarn = |string|
  iv_workflowversion = |string|
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  lv_idstring = lo_result->get_runid( ).
  lv_workflowrunstatus = lo_result->get_status( ).
  lv_timestampvalue = lo_result->get_startedat( ).
ENDIF.