Developer

How to Use Account Store, Flow Store, and Memory Store

webMethods.io Integration allows you to store key-value pairs and fetch them when required during a workflow execution. WebMethods.io Integration provides this functionality with three data store actions, namely, Account Store, Flow Store, and Memory Store. Though all the three data store actions seem to perform the same task, there are certain key differences in their features that make them ideal for different scenarios. Let’s now know exactly what each of these actions do and understand how to use them.

How to Use Account Store

The Account Store action lets you store one or more key-value pairs with a global scope and retrieve them during any workflow execution. This means that, each key-value pair you store using the Account Store action can be retrieved while working with any workflow of any project in your tenant. Let’s understand this with the help of an example.

Let’s say we have two different projects: Default and Recipes. In Default, we will create a workflow to set a key-value pair. Next, we will retrieve the value of this key using the workflow created in the Recipe project.

Set Key-Value Pairs with Account Store

  1. Add action to canvas

    Add Account Store action on canvas and connect it to the Start and Stop icons as shown below:

  2. Configure the Account Store action

    Double-click the Account Store action icon, optionally provide a suitable name for this action, and then click Next. This will take you to the Account Store action configuration screen. Configure this action as per the instructions given below:

    • Account Store: Since we want to set a key-value pair, select Set from the drop down field.
    • Key (mandatory): Provide a suitable name for the key you want to set.
    • Value: Enter the value you want to assign to the specified key.
    • You can set as many key-value pairs as you want by clicking on the + button. Once you have entered all the required details, click on Next optionally Test the action (click here to know how), and then click on Done to return to the canvas.

      Note: If you add a new key with a name that already exists but with a different value, webMethods.io Integration will overwrite the previously stored value of the key. If you want to delete the value of an existing key, keep the corresponding value field empty. Once you do that, Save and Run the workflow to delete the data in the value field permanently.

      With this, you have successfully created and stored the key-value pairs. Once you add the key-value pairs, you can fetch them anytime in the future. Let’s now understand how to retrieve values of the stored keys.

Retrieve Values of Stored Keys from Account Store

We will now understand how to retrieve the value of stored keys with Account Store action. For this, we will create a workflow in the project named Recipes with Account Store action to retrieve value of a stored key and then post its details on a Slack channel.

  1. Add actions/connectors to canvas:

    Add Account Store action and Slack connector to canvas and connect them as shown below.

    Now that the actions are added to the canvas, the next step is to configure these actions.

  2. Configure Account Store action

    Double-click the Account Store action icon, optionally provide a suitable name for this action, and then click Next. This will take you to the Account Store action configuration screen. Configure this action as per the instructions given below:

    • Account Store: Since we want to get the value for a stored key, select Get from the drop down field.

    • Key (mandatory): Provide the name of the stored key of which value you want to retrieve. You can fetch values of multiple keys by clicking on the + button.

    Once you have entered all the required details, click on Next, optionally Test the action (click here to know how), and then click on Done to return to the canvas.

    Next, configure the Slack - Post New Message action as you would normally do to post what we retrieved earlier on the specified Slack channel.

    Once this is done, Save the workflow. Now when you Run the workflow, webMethods.io Integration will automatically fetch the value of the key and post it on the specified Slack channel.

How to Use Flow Store

The Flow Store action lets you store one or more key-value pairs and retrieve them when required within the same workflow of the project. Each key-value pair you set using the Flow Store has local scope by default. This means the keys stored inside a workflow can be retrieved from within the same workflow only.

Let’s understand how to set key-value pairs and retrieve their values using the Flow Store action with the help of an example.

Set Key-Value Pairs with Account Store

  1. Add action to canvas

    Add Flow Store action on the canvas and connect to the Start and Stop icons as shown below:

    Now that the action is added to the canvas, the next step is to configure the Flow Store action.

  2. Configure the Flow Store action

    Double-click the Flow Store action icon, optionally provide a suitable name for this action, and then click Next. This will take you to the Flow Store action configuration screen. Configure this action as per the instructions given below:

    • Flow Store: Since we want to set a key-value pair, select Setfrom the drop down field.
    • Key (mandatory): Provide a suitable name for the key you want to set.
    • Value: Enter the value you want to assign to the specified key. You can set as many key-value pairs as you want by clicking on the + button.
    • Note: If you add a new key with a name that already exists but with a different value, webMethods.io Integration will overwrite the previously stored value of the key.

      Once you have entered all the required details, click on Next, optionally Test the action (click here to know how), and then click on Done to return to the canvas.

      With this, you have successfully created and stored the key-value pair(s). Once you have created and stored the key-value pairs, you can retrieve them from the same workflow. Let’s now understand how to get or retrieve values of the stored keys.

Retrieve Values of Stored Keys with Flow Store

To get or retrieve values of the stored keys, we will have to add the Flow Store action in the same workflow where we had stored and then post its details on a Slack channel.

  1. Add actions/connectors to the canvas Add Flow Store and Slack action on the canvas and connect to the Start and Stop icons as shown below:

    Now that the actions are added, the next step is to configure these actions.

  2. Configure the Flow Store action

    Double-click the Flow store action icon, optionally provide a suitable name for this action, and then click Next. This will take you to the Flow Store action configuration screen. Configure this action as per the instructions given below:

    • Flow Store: Since we want to get the value for a stored key, select Get from the drop down field.

    • Key (mandatory): Provide the name of the stored key of which value you want to retrieve. You can fetch the value of multiple stored keys by clicking on the + button.

    Once you have entered all the required details, click on Next, optionally Test the action (click here to know how), and then click on Done to return to the canvas.

    Next, configure the Slack - Post New Message action as you would normally do to post the key value details we retrieved earlier on the specified Slack channel.

    Once this is done, Save the workflow. Now when you Run the workflow, webMethods.io Integration will automatically fetch the value of the key and post it on the specified Slack channel.

    Note: If you store value for a particular key in a workflow within a project and try to retrieve its value in another workflow within the same project, the workflow will not successfully execute.

How to Use Memory Store

The Memory Store action lets you store and retrieve one or more key-value pairs which is limited to only one workflow run. This means that one Memory Store action can be executed only once. With a single Memory Store action, you can either set key-value pairs or retrieve values of stored keys. So, if want to Set key-value pairs and Get the values of stored keys in the same workflow, you will have to add two Memory Store actions in the same workflow.

Let’s now understand how to set key-value pairs and retrieve the values using the Memory Store action with the help of an example. Let’s say, we have a workflow that sets a key-value pair, get the values for the stored key, and post the value details on the specified Slack channel.

Set Key-Value Pairs and Retrieve Values of Stored Keys with Memory Store

  1. Add actions/connectors to canvas

    Add two Memory Store actions, one for setting key-value pairs and another one for retrieving values of stored keys, to the canvas, along with the Slack connector. Connect these actions and connector to the Start and Stop icons as shown below:

  2. Configure Memory Store action for Setting Key-Value Pairs

    Double-click the first Memory store action icon to Set key-value pairs. Optionally provide a suitable name for this action, and then click Next. This will take you to the Memory Store action configuration screen. Configure this action as per the instructions given below:

    • Memory Store: Since we want to set a key-value pair, select Set from the drop down field.
    • Key (mandatory): Provide a suitable name for the key you want to set.
    • Value: Enter the value you want to assign to the specified key. You can set as many key-value pairs as you want by clicking on the + button.
    • Once you have entered all the required details, click on Next, optionally Test the action (click here to know how), and then click on Done to return to the canvas.

      With this, you have successfully created and stored the key-value pairs.

    • Configure the Memory Store action for retrieving values for stored keys

      Double-click the second Memory Store action icon to Get value details of the stored key. Optionally provide a suitable name for this action, and then click Next. This will take you to the Memory Store action configuration screen. Configure this action as per the instructions given below:

      • Memory Store: Since we want to get the value for a stored key, select Get from the drop down field.

      • Key (mandatory): Provide a suitable name of the stored key of which value you want to retrieve. You can retrieve the value of multiple stored keys by clicking the + button.

      Once this is done, click Next, optionally Test the action (click here to know how), and then click on Done to return to the canvas.

      Next, configure the Slack - Post New Message action as you would normally do, to post the key value details we retrieved earlier on the specified Slack channel.

      Once this is done, Save the workflow. Now, when you Run the workflow, you will get the value details on the specified Slack channel. If you try to execute this workflow again however, you will not get the desired result, as each Memory Store action is limited to one workflow run only.

How Return Data on Sync Webhook works

The Return Data on Sync Webhook action enables you to run a workflow by calling a URL (webhook URL) and get the workflow’s output in the body of the URL.

We will understand how this action works with the help of an example.

Example

Let’s say, you have a workflow that creates a board in your Trello account, posts the details of the board on the specified Slack channel, and also sends board details via Email

Once all the actions have been configured and connected, double-click the Start icon. A new screen will appear containing a list of trigger services. Select Webhook trigger from the list.

On clicking the Webhook trigger, a unique webhook URL will be generated. You can optionally add an extra layer of security to your webhook URL by enabling the webhook authentication option. Click on Next and then on Done to go back to the canvas.

At this point, if you hit this webhook URL in any browser, the workflow will get executed automatically, and you will receive the following response in the browser window:

Now, drag and dropReturn Data on Sync Webhook as the last action of your workflow. In our example, we will add the action after the Send an email action as shown in the image below:

Configure the Return Data on Sync Webhook action and insert values in the given fields as per the instructions given below:

Response Headers: Enter the details of a single or multiple headers in a key-value pair format. In our example, since our workflow output is straightforward and don’t require any header details, we haven’t entered the header values. If in your case the application requires this input, you can enter the header details in the required key-value pair format.

Response Data (Mandatory): Add the output of any of the previous actions that you want to retrieve through the webhook. It’s possible to add more than one outputs from previous actions in this field. You can select the outputs from the list given on the left hand side of the window. In our example, we will select the board name for the ‘Response Data’ field.

Status code: Enter the status code value that you want to display along with the output. By default the value for this field is set to 200. You can also specify the custom message.

Content Type: Select/specify the content type in which you want to receive the workflow output.

Once you have added this action to your workflow, ‘?sync=true’ will be automatically appended to your webhook URL as shown in the image below.

The ‘Return Data on Sync Webhook’ will sync the workflow with webhook URL and will send the workflow output to it when the Webhook URL is hit.

Now when the Webhook URL is hit, you can see the required board details on the screen.

How to Create Custom OAuths for Google Connectors

webMethods.io Integration lets you create custom OAuths for the supported Google connectors. This custom OAuths can then be used to configure supported triggers and actions.

When you are configuring an action or a trigger, you are prompted to select an existing account or create a new account. To create custom OAuth, click the + icon located beside the Authorize {connector_name} label. You will be redirected to the screen given below:

Here, you need to enter the relevant details associated with your Google service account to create custom OAuth.

Refer the sections to retrieve the relevant details required to create a custom OAuth.

Retrieving Client ID and Client Secret

You need to have a relevant Google connector app in Google Cloud Platform to retrieve its Client ID and Client Secret. We will first understand how to create an app for a Google Connector (if you have already created an app, skip to step 4).

Let’s say you want to create an app for Dialogflow. To do this, follow the steps given below:

  1. Login to Google Cloud Platform and create a new project

    First, login to Google Cloud Platform. You will be prompted to create a new project.

    Once you have entered the relevant details, click Create. This will redirect you to the project dashboard.

  2. Enable service APIs

    Click on the + ENABLE APIS AND SERVICES button.

    This will take you to the Google API library where you can view a list of all services supported by Google.

    Click the service for which you want to create an app.

    This will set up the selected service API in your account. Click on Enable to enable it for your account.

  3. Set up OAuth Client ID

    Once the API is enabled, you will be redirected to the API dashboard.

    Click on the Credentials menu listed in the left-side panel, and then select the OAuth Client ID option from the CREATE CREDENTIALS dropdown menu.

    You will be prompted to Configure the consent screen details. To do so, click the Configure consent screen button.

    This will take you to OAuth Consent screen screen where you need to provide the following details:

    • Application type: Specify whether you want to create a public or private application.

    • Application name: Provide a suitable name for your application.

    • Authorized domains: Enter the domain(s) for which you want to enable OAuth access.

    Once this is done, click Save.

    Set Application type to Web in the next screen that appears and specify the redirect URL in the Authorized redirect URIs field.

    Note: The redirect URI should match with the domain(s) you have specified in the previous screen.

    Once this is done, click Create. With this, your app will be successfully created.

  4. Retrieve Client ID and Client Secret

    As soon as the app is created, you will see the Client ID and Client Secret in the pop-up window.

    You can alternatively view the Client ID and Client Secret by navigating to relevant project dashboard, and clicking the Credentials menu listed in the left-side panel.

    You will see the list of all existing OAuths clients.

    Locate the OAuth client of which Client ID and Client Secret keys you want to retrieve, and click on the Edit OAuth Client icon given against it.

    This will take you to the OAuth Client configuration screen where you can see the Client ID and Client secret for the selected app at the top of the page.

    Copy the Client ID and Client Secret from here and add them to the respective fields in the Add Account window.

Retrieving Access Token and Request Token

You can use services like Postman to retrieve the Access Token and Request Token. To do this, you need to perform two steps where you make two API requests to relevant Google service.

  1. Retrieve authorization code required to fetch access token and request token.

    Open Postman and set up the first request as given below:

    Key Value
    client_id {Enter client_id}
    redirect_uri {Enter redirect_uri}
    response_type code
    scope {Enter relevant scope from this list}
    include_granted_scopes true
    state pass through value
    prompt consent
    access_type offline

    Once this is done, you will notice that the params passed by you are appended to the request URL. Copy this modified request URL, paste it in any browser, and hit enter.

    You will be prompted to select the Gmail account you want to use. Once you do this, you will see the consent screen for the app created by you.

    Click Allow. This will take you to the homepage of your app. Copy the value of the code key displayed in the address bar and save it in any text editor. We will need this key in the next step when we send the request to retrieve the Access Token and Request Token.

  2. Retrieve Access Token and Refresh Token

    Open Postman and set up the second request as given below:

    Key Value
    client_id {Enter client_id}
    redirect_secret {Enter client_secret}
    redirect_uri {Enter redirect_uri}
    grant_type authorization_code
    code {code retrieved from step 1}

    Once you have entered all the details, click Send. This will return the Access Token and Request Token along with other details in the Body tab of the response.

    Copy the Access Token and Request Token from here and add them to the respective fields in the Add Account window.

    Note: The value of Refresh URL will always be https://www.googleapis.com/oauth2/v4/token and the value of Grant Type will always be refresh_token for all Google connectors.

List of Scopes for Google Services

Table given below contains the scope(s) to be used while sending the first request in order to retrieve the Access Token and Refresh Token.

Note: Use space separator in case of multiple scopes.

Service Name Scope(s)
Dialogflow https://www.googleapis.com/auth/cloud-platform https://www.googleapis.com/auth/dialogflow

How to read the contents of a downloaded file

When you download any file using Google Drive, Dropbox, or other such applications, it is saved temporarily in the webMethods.io Integration engine local storage. In order to read/access this file, you need to use other online file storage applications where this file can be uploaded. Let’s understand how it works with the help of an example.

Suppose you need to download a file using Google Drive and read it. To do this, follow the steps given below:

Configure the Google Drive-Download File by ID action

  1. Add the Google Drive connector to canvas, connect it to the Start icon, and double-click the connector icon. This will open the configuration window where you can select the action you want to use.

    Select Action: For the purpose of this tutorial, select the downloadFileById action from the drop down list. This will populate the below two fields:

    • Name: Provide a label for the action you want to configure.
    • Authorize Google Drive: Select the account you want to use to execute the action, from the drop‐down list. If you have not created an account yet, click on the + button. You will see two options:
      • Default Authorization: Select this option to allow webMethods.io Integration to automatically generate all keys required to execute all Google Drive actions.
      • Or: Select this option to provide the relevant keys required to execute all Google Drive actions.
      • Select one of the options, provide the required information as prompted on the screen, and click Add.
      • This will create a new account for your Google Drive account. Once you create an account, you can use it to execute all other Google Drive actions and triggers.
  2. Once this is done, click Next, test the action, and click Done.

    At this stage, if you run the workflow, the specified file will be downloaded to webMethods.io Integration engine local storage. To read/access this file, use Dropbox Download file action (or any other similar action of a cloud storage application).

Configure the Dropbox-Upload File action

  1. Add Dropbox connector to canvas, connect it to the Google Drive connector, and double-click the Dropbox connector.

  2. Select the Upload File action, provide a label for action, and add or select the account you want to use to execute the action, just like we did for Google Drive.

  3. Once you have entered all the details, click NEXT, test the action, and click Done

Save and run the workflow

Connect the Dropbox application icon with the Stop icon, Save the workflow, and click on Test.

This will download the specified file from your Google Drive account and upload it to the specified folder in Dropbox, where you can read the file.

How to get data from the action and push it to another...

The output of the first action can be used as an input for another action by using the keys given on the left-side of the configuration window. Let’s see how to do this with the help of an example.

In this example workflow, we will fetch the details of a particular campaign from your Marketo account, and use those details to create a new campaign in your Salesforce account.

Add actions

  1. To do this, add Marketo and Salesforce connectors to your webMethods.io Integration canvas, and connect them in the order shown below:

Use output

  1. Configure the Marketo-getLeadById action

    Double click the Marketo connector icon and select the getLeadByIdaction from the Select Action drop down list. When you do this, two more fields will be populated in the window.

    Provide the name for the action and select/add the account for Marketo , and click Next.

    Select/specify the ID of the campaign that you want to fetch in the Campaign ID field.

    Once this is done, click Next and test the action by clicking on the Test button.

    This serves two purposes: First, it checks whether the action has been configured properly or not, and second, it fetches the details of the latest campaign and displays it in the output tab.

    Once this is done, click Done to return to the canvas.

  2. Configure the Salesforce - createLeads action

    We will now configure the Salesforce — createLeads action. To do so, double-click the Salesforce connector icon, select the Create Campaign action in the window that appears, and select the appropriate Salesforce account you want to use to execute the action. Once this is done, click Next.

    Here, you can see the output data of the Marketo — getLeadById action on the left-side of the screen. This output data includes output keys returned by the action output. You can use these keys to provide inputs for the Salesforce - Create Leads action.

Similar Instances

Similarly, you can add other details of the campaign, such as company and city

Once you are done with this, click Next.

You can now optionally test the configured action by clicking Test or go back to canvas by clicking Done.

Now, when you Save and Test this workflow, webMethods.io Integration will then automatically fetch the details of the specified Marketo campaign and, using those details, create a new Salesforce campaign.

How to fetch the PagerDuty incident details and post them on Cisco Webex Teams space and Slack channel

You can fetch the details of the incoming PagerDuty incidents and instantly post them on Cisco Webex Teams space and Slack channel.

How it works

To do this, follow the steps given below:

  1. Add and configure the PagerDuty - New Incident trigger as instructed below:

    • Trigger Label: Enter a suitable name for the trigger.

    • Select Trigger: Select New Incident trigger from the options available in the drop-down list. This instructs the webMethods.io Integration to trigger the workflow whenever a new incident is added in a particular service in your PagerDuty account.

    • Authorize PagerDuty: In order to use this trigger, you will have to first create PagerDuty account. Click the + button, and create your account using either Default Authorization option or service access token (i.e., Or option). If you have already created an account, select it from the drop-down list.

    • Service ID: Select/specify the ID of the service for which the trigger is to be set. In PagerDuty, the service ID could be found in the URL of the service. E.g.: PQQB1HE

    Once you have entered the details, click Done. This will take you back to canvas.

  2. Add Cisco Webex Teams connector to the canvas and connect it to the PagerDuty trigger.

    Double-click the Cisco Webex Teams connector icon, select the Post New Message action from the Select Action drop down list, and select the Cisco Webex Teams account you want to use to execute the action.

    Once this is done, click Next. In the action configuration form that appears next, provide the details as given below:

    • Space ID: Select/specify the ID of the space on which you want to post the message.

    • Message: Specify the message that you want to post in the space. In this case, we will enter a custom message, along with the output of the PagerDuty trigger.

    Once you have entered the details, click Done. This will take you back to canvas.

  3. Add Slack connector to the canvas and connect it to the PagerDuty trigger.

    Next, double-click the Slack connector icon, select the chatPostMessage action from the Select Action drop down list, and select the Slack account you want to use to execute the action. Once this is done, click Next.

    In the action configuration form that appears next, provide the details as given below:

    • channel: Enter the ID of the channel on which you want to post the message.

    • text: Specify the message that you want to send to the channel. In this case, we will enter a custom message, along with the output of the PagerDuty trigger.

    Once you have entered all the details, click the Next button, Test the action, and click the Done button to return to the canvas.

  4. Connect the Cisco Webex Teams and Slack connectors to the Stop icon and Save the workflow.

    Now, whenever a new incident is triggered in the specified service in PagerDuty, this workflow will send the incident details to the specified Cisco Webex Teams space and Slack channel.

How to use Swagger Action

WebMethods.io Integration lets you access the APIs and make API calls of any service that is built either using RAML or Swagger. The integration platform provides this novel functionality with action - Swagger.

In this guide, we will help you understand how to use Swagger.

How to use Swagger

The Swagger action lets you access the APIs and make API calls to any service that is built using Swagger. In essence, this action lets you create a custom action form by simply entering a JSON file.

  1. Add the Swagger action to the canvas as shown below.

  2. Double-click on the Swagger action, you will see a window appearing on the screen. In the Swagger File URL field, enter the URL for the swagger JSON file of the service you want to get the APIs of, optionally enter the service account credentials, and click on the ‘Fetch’ button. For example, if you want to retrieve the APIs of Petstore, enter http://petstore.swagger.io/v2/swagger.json in the Swagger File URL field, enter credentials and click on Fetch. (Petstore is a sample Swagger JSON).

  3. A new Select an API field will be automatically added to the form. Select the API you want to execute and then click on Next.

  4. Once you have selected an API, the API form will automatically display all the mandatory as well as optional fields of the selected API call.

  5. Enter relevant data in the fields, and click on Done to return to your canvas. Now, when you test the workflow with this action, the selected API call will be executed.