:doc:`SFN <../../stepfunctions>` / Client / start_sync_execution

********************
start_sync_execution
********************



.. py:method:: SFN.Client.start_sync_execution(**kwargs)

  

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

   

  .. note::

    

    ``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.

    

   

  .. note::

    

    This API action isn't logged in CloudTrail.

    

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/StartSyncExecution>`_  


  **Request Syntax**
  ::

    response = client.start_sync_execution(
        stateMachineArn='string',
        name='string',
        input='string',
        traceHeader='string',
        includedData='ALL_DATA'|'METADATA_ONLY'
    )
    
  :type stateMachineArn: string
  :param stateMachineArn: **[REQUIRED]** 

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

    

  
  :type name: string
  :param name: 

    The name of the execution.

    

  
  :type input: string
  :param input: 

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

     

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

     

    .. note::

      

      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.

    

  
  :type traceHeader: string
  :param traceHeader: 

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

     

    .. note::

      

      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.

      

    

  
  :type includedData: string
  :param includedData: 

    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.

    

  
  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {
          'executionArn': 'string',
          'stateMachineArn': 'string',
          'name': 'string',
          'startDate': datetime(2015, 1, 1),
          'stopDate': datetime(2015, 1, 1),
          'status': 'SUCCEEDED'|'FAILED'|'TIMED_OUT',
          'error': 'string',
          'cause': 'string',
          'input': 'string',
          'inputDetails': {
              'included': True|False
          },
          'output': 'string',
          'outputDetails': {
              'included': True|False
          },
          'traceHeader': 'string',
          'billingDetails': {
              'billedMemoryUsedInMB': 123,
              'billedDurationInMilliseconds': 123
          }
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **executionArn** *(string) --* 

        The Amazon Resource Name (ARN) that identifies the execution.

        
      

      - **stateMachineArn** *(string) --* 

        The Amazon Resource Name (ARN) that identifies the state machine.

        
      

      - **name** *(string) --* 

        The name of the execution.

        
      

      - **startDate** *(datetime) --* 

        The date the execution is started.

        
      

      - **stopDate** *(datetime) --* 

        If the execution has already ended, the date the execution stopped.

        
      

      - **status** *(string) --* 

        The current status of the execution.

        
      

      - **error** *(string) --* 

        The error code of the failure.

        
      

      - **cause** *(string) --* 

        A more detailed explanation of the cause of the failure.

        
      

      - **input** *(string) --* 

        The string that contains the JSON input data of the execution. Length constraints apply to the payload size, and are expressed as bytes in UTF-8 encoding.

        
      

      - **inputDetails** *(dict) --* 

        Provides details about execution input or output.

        
        

        - **included** *(boolean) --* 

          Indicates whether input or output was included in the response. Always ``true`` for API calls.

          
    
      

      - **output** *(string) --* 

        The JSON output data of the execution. Length constraints apply to the payload size, and are expressed as bytes in UTF-8 encoding.

         

        .. note::

          

          This field is set only if the execution succeeds. If the execution fails, this field is null.

          

        
      

      - **outputDetails** *(dict) --* 

        Provides details about execution input or output.

        
        

        - **included** *(boolean) --* 

          Indicates whether input or output was included in the response. Always ``true`` for API calls.

          
    
      

      - **traceHeader** *(string) --* 

        The X-Ray trace header that was passed to the execution.

         

        .. note::

          

          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.

          

        
      

      - **billingDetails** *(dict) --* 

        An object that describes workflow billing details, including billed duration and memory use.

        
        

        - **billedMemoryUsedInMB** *(integer) --* 

          Billed memory consumption of your workflow, in MB.

          
        

        - **billedDurationInMilliseconds** *(integer) --* 

          Billed duration of your workflow, in milliseconds.

          
    
  
  **Exceptions**
  
  *   :py:class:`SFN.Client.exceptions.InvalidArn`

  
  *   :py:class:`SFN.Client.exceptions.InvalidExecutionInput`

  
  *   :py:class:`SFN.Client.exceptions.InvalidName`

  
  *   :py:class:`SFN.Client.exceptions.StateMachineDoesNotExist`

  
  *   :py:class:`SFN.Client.exceptions.StateMachineDeleting`

  
  *   :py:class:`SFN.Client.exceptions.StateMachineTypeNotSupported`

  
  *   :py:class:`SFN.Client.exceptions.KmsAccessDeniedException`

  
  *   :py:class:`SFN.Client.exceptions.KmsInvalidStateException`

  
  *   :py:class:`SFN.Client.exceptions.KmsThrottlingException`

  