---
title: "Workflow Meshlets with ServiceBond"
canonical: "https://docs.perspectium.com/space/Lithium/2326632/Workflow%20Meshlets%20with%20ServiceBond"
format: markdown
---
Only authorized users can access this page. The  Workflow Meshlet  provides the capability to integrate third-party APIs with the Perspectium Integration Mesh. If there is an application or endpoint that you want to integrate to, you can use the Workflow Meshlet to talk to the application or endpoint's API.  Before you begin, let's take a look at the API methods: The steps API is a collection of methods which should be chained together to create a workflow. Each step calls one method, and each method has access to a context variable which is used in the method. Variables can be added to the context via the workflow mapping, and each method can also add variables to the context to be used in later methods. The variables required and variables set are listed in each method description below. Only plaintext strings can be added as variables via the workflow mapping, so most variables need to be set by previous step methods. Use the API documentation below to create a workflow that handles your particular use case. You should be setting up two workflows, one going from the provider to common document and one from common document to the provider: Common Document to Provider Context variables provided: action common_document rest_service Procedure: Generally for this workflow you will need to call c reateBodyFromCommonDocument  which sets a  body  context variable, which you can then send using an HTTP request step such as  post . Provider to Common Document (Webhook) Context variables provided: body rest_service Procedure: Generally for this workflow you will need to call  parseJsonBody  then  createCommonDocumentFromJson  which sets a  common_document  context variable. Next, call  createMessageFromCommonDocument  and send the message using  publishToQueue . Provider to Common Document (Query) Context variables provided: last_updated rest_service Procedure: Generally for this workflow you need to call  setResponseAsBody  to get the response body from querying the provider API, then call  compareTimestamps  to check whether the query results have been processed already. The rest of the workflow can be the same as the webhook workflow. Method List: Configuring a Workflow Meshlet is done through three procedures: Creating the mappings Configuring the YAML files Running the meshlet command Mappings allows you to choose how fields are mapped, how values inside fields are mapped, and most importantly how the “workflow” runs. There are three types of mappings: field mappings, value mappings, and workflow mappings. The  /static/config/...  folder holds the JSON files that will map fields, values and workflows. The  /static/mapping/...  folder contains the directory that holds the files that will be used for the JSON files in the /static/config/... directory. To create the mappings needed, follow these steps:  The  application-dev.yml  file contains the Meshlet’s runtime configurations such as which Perspectium Integration Mesh to connect to.  Specific to the Workflow Meshlet are the following configurations: Example of application-dev.yml file: The command should be run with the type of authentication being used in the provider API. Currently this can be either basicauth or OAuth. For example, with oauth: Run the command in the base directory where the directory structure looks like the following: /logs /data /static /config /mapping /default /values /workflows