Using the MES Web API in a Workflow
- Last UpdatedNov 06, 2025
- 4 minute read
Note: The procedures in this section assume that the MDMMESMWV3_1.0 Web API is being used. Adding an MES Web API Activity to a Workflow
The general steps for adding an activity to a workflow that calls an MES Web API endpoint are as follows.
- Add the Invoke Web API activity to the workflow.

- Open the Web API Configuration dialog for the activity.
![]()
- Enter the following properties:
Web API
Select the MES Web API list item to be used.
Operation Group
Select the operation group for the operation to be used.
Operation
Select the operation.
Body
Select the Parameters option and enter the applicable input parameters.
Optionally, you can select the Raw option to manually enter the parameters if more flexibility in the parameter content is required.
Content Type
If the endpoint requires a request body, this is the content type of the request body, typically application/json.
Output Settings
If you want to map the output of the call to, for example, an XML variable, select the output type and the name of the variable here.
Initiating a Transaction
The following screen shot shows an example of the configuration for a Web API workflow activity that initiates a transaction using the Post Transaction endpoint. The endpoint returns a transaction ID and saves it to the XML variable TransactionID. Note that this transaction variable must be manually created in the workflow's Start activity before attempting to use it in a Web API activity.

Passing the Transaction ID with Another Web API Activity
The following screen shot shows an example of the request URI for a Web API workflow activity that passes the transaction ID as part of the activity's endpoint.

Committing a Transaction
If the workflow results in a successful transaction, you can use the Put Transaction in a workflow activity that is configured to commit the transaction. The following screen shot shows an example of the request URI with the transaction's action set to commit.

Rolling Back a Transaction
If the workflow results in an unsuccessful transaction, you can use the Put Transaction in a workflow activity that is configured to roll back the transaction. The following screen shot shows an example of the request URI with the transaction's action set to rollback.

Configuring Variables to Get Error Messages from a Failed Call
To configure a workflow to get error messages from a failed call:
- Select the workflow's Start activity and, in the Properties panel, click the Variables button

- In the Variables dialog, add a WebAPIErrorDetails variable (for MES Web API call error messages) and a WebAPIErrorMessage variable (for HTTP error messages) for each Web API activity for which you want to get error messages.
The format of the variable names must be exactly as follows:
The caret character (^), followed by the exact activity name (which is case sensitive), followed by an underscore (_) and then either WebAPIErrorDetails or WebAPIErrorMessage. The following screen shot shows the message variables added for the StartJob activity.

- To enable the error message output for a Fail activity, in the Properties panel click its Set Blocking Output button.

- In the Set Blocking Output dialog, enter the output message using the activity's two error message variables. An example for the StartJob failure activity is shown below.
