Skip to content

/AWS1/CL_SFN=>STARTSYNCEXECUTION()

About StartSyncExecution

Starts a Synchronous Express state machine execution. StartSyncExecution is not available for STANDARD workflows.

StartSyncExecution will return a 200 OK response, even if your execution fails, because the status code in the API response doesn't reflect function errors. Error codes are reserved for errors that prevent your execution from running, such as permissions errors, limit errors, or issues with your state machine code and configuration.

This API action isn't logged in CloudTrail.

Method Signature

IMPORTING

Required arguments:

iv_statemachinearn TYPE /AWS1/SFNARN /AWS1/SFNARN

The Amazon Resource Name (ARN) of the state machine to execute.

Optional arguments:

iv_name TYPE /AWS1/SFNNAME /AWS1/SFNNAME

The name of the execution.

iv_input TYPE /AWS1/SFNSENSITIVEDATA /AWS1/SFNSENSITIVEDATA

The string that contains the JSON input data for the execution, for example:

"{\"first_name\" : \"Alejandro\"}"

If you don't include any JSON input data, you still must include the two braces, for example: "{}"

Length constraints apply to the payload size, and are expressed as bytes in UTF-8 encoding.

iv_traceheader TYPE /AWS1/SFNTRACEHEADER /AWS1/SFNTRACEHEADER

Passes the X-Ray trace header. The trace header can also be passed in the request payload.

For X-Ray traces, all Amazon Web Services services use the X-Amzn-Trace-Id header from the HTTP request. Using the header is the preferred mechanism to identify a trace. StartExecution and StartSyncExecution API operations can also use traceHeader from the body of the request payload. If both sources are provided, Step Functions will use the header value (preferred) over the value in the request body.

iv_includeddata TYPE /AWS1/SFNINCLUDEDDATA /AWS1/SFNINCLUDEDDATA

If your state machine definition is encrypted with a KMS key, callers must have kms:Decrypt permission to decrypt the definition. Alternatively, you can call the API with includedData = METADATA_ONLY to get a successful response without the encrypted definition.

RETURNING

oo_output TYPE REF TO /aws1/cl_sfnstartsyncexecout /AWS1/CL_SFNSTARTSYNCEXECOUT

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->/aws1/if_sfn~startsyncexecution(
  iv_includeddata = |string|
  iv_input = |string|
  iv_name = |string|
  iv_statemachinearn = |string|
  iv_traceheader = |string|
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  lv_arn = lo_result->get_executionarn( ).
  lv_arn = lo_result->get_statemachinearn( ).
  lv_name = lo_result->get_name( ).
  lv_timestamp = lo_result->get_startdate( ).
  lv_timestamp = lo_result->get_stopdate( ).
  lv_syncexecutionstatus = lo_result->get_status( ).
  lv_sensitiveerror = lo_result->get_error( ).
  lv_sensitivecause = lo_result->get_cause( ).
  lv_sensitivedata = lo_result->get_input( ).
  lo_cloudwatcheventsexecuti = lo_result->get_inputdetails( ).
  IF lo_cloudwatcheventsexecuti IS NOT INITIAL.
    lv_includeddetails = lo_cloudwatcheventsexecuti->get_included( ).
  ENDIF.
  lv_sensitivedata = lo_result->get_output( ).
  lo_cloudwatcheventsexecuti = lo_result->get_outputdetails( ).
  IF lo_cloudwatcheventsexecuti IS NOT INITIAL.
    lv_includeddetails = lo_cloudwatcheventsexecuti->get_included( ).
  ENDIF.
  lv_traceheader = lo_result->get_traceheader( ).
  lo_billingdetails = lo_result->get_billingdetails( ).
  IF lo_billingdetails IS NOT INITIAL.
    lv_billedmemoryused = lo_billingdetails->get_billedmemoryusedinmb( ).
    lv_billedduration = lo_billingdetails->get_billeddurinmilliseconds( ).
  ENDIF.
ENDIF.