Skip to content

/AWS1/IF_MWS=>CREATEWORKFLOW()

About CreateWorkflow

Creates a new workflow in Amazon Managed Workflows for Apache Airflow Serverless. This operation initializes a workflow with the specified configuration including the workflow definition, execution role, and optional settings for encryption, logging, and networking. You must provide the workflow definition as a YAML file stored in Amazon S3 that defines the DAG structure using supported Amazon Web Services operators. Amazon Managed Workflows for Apache Airflow Serverless automatically creates the first version of the workflow and sets up the necessary execution environment with multi-tenant isolation and security controls.

Method Signature

METHODS /AWS1/IF_MWS~CREATEWORKFLOW
  IMPORTING
    !IV_NAME TYPE /AWS1/MWSNAMESTRING OPTIONAL
    !IV_CLIENTTOKEN TYPE /AWS1/MWSIDEMTOKENSTRING OPTIONAL
    !IO_DEFINITIONS3LOCATION TYPE REF TO /AWS1/CL_MWSDEFNS3LOCATION OPTIONAL
    !IV_ROLEARN TYPE /AWS1/MWSROLEARN OPTIONAL
    !IV_DESCRIPTION TYPE /AWS1/MWSDESCRIPTIONSTRING OPTIONAL
    !IO_ENCRYPTIONCONFIGURATION TYPE REF TO /AWS1/CL_MWSENCRYPTIONCONF OPTIONAL
    !IO_LOGGINGCONFIGURATION TYPE REF TO /AWS1/CL_MWSLOGGINGCONF OPTIONAL
    !IV_ENGINEVERSION TYPE /AWS1/MWSENGINEVERSION OPTIONAL
    !IO_NETWORKCONFIGURATION TYPE REF TO /AWS1/CL_MWSNETWORKCONF OPTIONAL
    !IT_TAGS TYPE /AWS1/CL_MWSTAGS_W=>TT_TAGS OPTIONAL
    !IV_TRIGGERMODE TYPE /AWS1/MWSGENERICSTRING OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_mwscreateworkflowrsp
  RAISING
    /AWS1/CX_MWSACCESSDENIEDEX
    /AWS1/CX_MWSCONFLICTEXCEPTION
    /AWS1/CX_MWSINTERNALSERVEREX
    /AWS1/CX_MWSOPERATIONTIMEOUTEX
    /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_name TYPE /AWS1/MWSNAMESTRING /AWS1/MWSNAMESTRING

The name of the workflow. You must use unique workflow names within your Amazon Web Services account. The service generates a unique identifier that is appended to ensure temporal uniqueness across the account lifecycle.

io_definitions3location TYPE REF TO /AWS1/CL_MWSDEFNS3LOCATION /AWS1/CL_MWSDEFNS3LOCATION

The Amazon S3 location where the workflow definition file is stored. This must point to a valid YAML file that defines the workflow structure using supported Amazon Web Services operators and tasks. Amazon Managed Workflows for Apache Airflow Serverless takes a snapshot of the definition at creation time, so subsequent changes to the Amazon S3 object will not affect the workflow unless you create a new version. In your YAML definition, include task dependencies, scheduling information, and operator configurations that are compatible with the Amazon Managed Workflows for Apache Airflow Serverless execution environment.

iv_rolearn TYPE /AWS1/MWSROLEARN /AWS1/MWSROLEARN

The Amazon Resource Name (ARN) of the IAM role that Amazon Managed Workflows for Apache Airflow Serverless assumes when executing the workflow. This role must have the necessary permissions to access the required Amazon Web Services services and resources that your workflow tasks will interact with. The role is used for task execution in the isolated, multi-tenant environment and should follow the principle of least privilege. Amazon Managed Workflows for Apache Airflow Serverless validates role access during workflow creation but runtime permission checks are performed by the target services.

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 creation requests.

iv_description TYPE /AWS1/MWSDESCRIPTIONSTRING /AWS1/MWSDESCRIPTIONSTRING

An optional description of the workflow that you can use to provide additional context about the workflow's purpose and functionality.

io_encryptionconfiguration TYPE REF TO /AWS1/CL_MWSENCRYPTIONCONF /AWS1/CL_MWSENCRYPTIONCONF

The configuration for encrypting workflow data at rest and in transit. Specifies the encryption type and optional KMS key for customer-managed encryption.

io_loggingconfiguration TYPE REF TO /AWS1/CL_MWSLOGGINGCONF /AWS1/CL_MWSLOGGINGCONF

The configuration for workflow logging. Specifies the CloudWatch log group where workflow execution logs are stored. Amazon Managed Workflows for Apache Airflow Serverless automatically exports worker logs and task-level information to the specified log group in your account using remote logging functionality. This provides comprehensive observability for debugging and monitoring workflow execution across the distributed, serverless environment.

iv_engineversion TYPE /AWS1/MWSENGINEVERSION /AWS1/MWSENGINEVERSION

The version of the Amazon Managed Workflows for Apache Airflow Serverless engine that you want to use for this workflow. This determines the feature set, supported operators, and execution environment capabilities available to your workflow. Amazon Managed Workflows for Apache Airflow Serverless maintains backward compatibility across versions while introducing new features and improvements. Currently supports version 1 with plans for additional versions as the service evolves.

io_networkconfiguration TYPE REF TO /AWS1/CL_MWSNETWORKCONF /AWS1/CL_MWSNETWORKCONF

Network configuration for the workflow execution environment, including VPC security groups and subnets for secure network access. When specified, Amazon Managed Workflows for Apache Airflow Serverless deploys ECS worker tasks in your customer VPC to provide secure connectivity to your resources. If not specified, tasks run in the service's default worker VPC with network isolation from other customers. This configuration enables secure access to VPC-only resources like RDS databases or private endpoints.

it_tags TYPE /AWS1/CL_MWSTAGS_W=>TT_TAGS TT_TAGS

A map of tags to assign to the workflow resource. Tags are key-value pairs that are used for resource organization and cost allocation.

iv_triggermode TYPE /AWS1/MWSGENERICSTRING /AWS1/MWSGENERICSTRING

The trigger mode for the workflow execution.

RETURNING

oo_output TYPE REF TO /aws1/cl_mwscreateworkflowrsp /AWS1/CL_MWSCREATEWORKFLOWRSP

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->createworkflow(
  io_definitions3location = new /aws1/cl_mwsdefns3location(
    iv_bucket = |string|
    iv_objectkey = |string|
    iv_versionid = |string|
  )
  io_encryptionconfiguration = new /aws1/cl_mwsencryptionconf(
    iv_kmskeyid = |string|
    iv_type = |string|
  )
  io_loggingconfiguration = new /aws1/cl_mwsloggingconf( |string| )
  io_networkconfiguration = new /aws1/cl_mwsnetworkconf(
    it_securitygroupids = VALUE /aws1/cl_mwssecuritygroupids_w=>tt_securitygroupids(
      ( new /aws1/cl_mwssecuritygroupids_w( |string| ) )
    )
    it_subnetids = VALUE /aws1/cl_mwssubnetids_w=>tt_subnetids(
      ( new /aws1/cl_mwssubnetids_w( |string| ) )
    )
  )
  it_tags = VALUE /aws1/cl_mwstags_w=>tt_tags(
    (
      VALUE /aws1/cl_mwstags_w=>ts_tags_maprow(
        key = |string|
        value = new /aws1/cl_mwstags_w( |string| )
      )
    )
  )
  iv_clienttoken = |string|
  iv_description = |string|
  iv_engineversion = 123
  iv_name = |string|
  iv_rolearn = |string|
  iv_triggermode = |string|
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  lv_workflowarn = lo_result->get_workflowarn( ).
  lv_timestampvalue = lo_result->get_createdat( ).
  lv_string = lo_result->get_revisionid( ).
  lv_workflowstatus = lo_result->get_workflowstatus( ).
  lv_workflowversion = lo_result->get_workflowversion( ).
  lv_islatestversion = lo_result->get_islatestversion( ).
  LOOP AT lo_result->get_warnings( ) into lo_row.
    lo_row_1 = lo_row.
    IF lo_row_1 IS NOT INITIAL.
      lv_string = lo_row_1->get_value( ).
    ENDIF.
  ENDLOOP.
ENDIF.