Creating First Workflow

Creating a workflow is fun and easy with webMethods.io Integration.

This tutorial will take you through the seven simple steps involved in creating a basic workflow.

Step 1: Select or add project

Once you log in, you will be redirected to the dashboard. Here, you will see a Default project, and the + New Project option to create a new project. Projects are like folders that save your workflows within them and help you categorize your workflows. Read more about Projects.

Click on the Default project to create a new workflow within it. 

9-create-project.png

You can optionally choose to create a new project. To do so, click on the + New Project button and provide a unique name for the project in the dialogue box that appears. When you click Create, you will be navigated to the Workflows screen, where you can start creating your first workflow.

Step 2: Create a blank Workflow

To create a new workflow, click the + New Workflow button. This will redirect you to a new window where you can choose one of the following options to create a workflow:

1. Create Blank Workflow: Create a blank workflow, and customize it as per your requirements using the wide list of applications supported by webMethods.io Integration.
2. Check Recipes: Use one of the ready-to-use workflow templates provided by webMethods.io Integration to get started quickly.

10-new-workflow.png


For this tutorial, we will create a new workflow by clicking on the Create Blank Flow button. This will navigate you to the webMethods.io Integration workflow canvas, where you can see an empty untitled workflow. This canvas is your playground. Here, you can mix and match triggers and operations to create some really awesome workflows.

Creating_First_Workflow.png

To rename the workflow, click on the Edit icon given beside the workflow name, at the top-left corner of the canvas. A new window will appear, where you can add/modify workflow details such as name, tags, and description. Once you have entered these details, click on Done. This will take you back to the canvas. 

Edit_workflow_name.png

Core components of a workflow

A workflow is essentially made up of two elements: A trigger and one or more actions. A trigger is something that fires off a workflow, and actions are the tasks that the workflow performs automatically. 

Let’s create a simple workflow: Whenever you post a new tweet in Twitter, send the tweet content to a Slack channel.

If we break this workflow into parts, we get:

Trigger → When you post a new tweet in Twitter

Actions → Post it on Slack channel.

Let’s start with setting up the trigger.

Step 3: Set up trigger

To get started with triggers, hover on the Start icon, and click the Settings icon that appears. A pop-up window will appear where you will see the list of trigger applications supported by webMethods.io Integration. Each of these applications has multiple triggers. Scroll down to locate the application you want, or search at the top if you have a specific application in mind.

In this case, we will look for Twitter and select it. This will redirect you to the trigger configuration window for Twitter.

Twitter.png


Step 3.1. Configure Twitter - New Tweet or Retweet Posted by Me trigger

We will now configure the New Tweet or Retweet Posted by Me trigger. To do this, enter details in the input fields as per the instructions given below:

Trigger Label: Provide a suitable name for this trigger. (E.g., Twitter - New Tweet or Retweet Posted by Me)

Select Trigger: Select the trigger, which when occurs, will fire off the workflow. For our example workflow, we will select New Tweet or Retweet Posted by Me. This trigger will start executing the workflow whenever you post a tweet via your Twitter account.

Authorize Twitter: 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 Twitter actions.
Or:
Select this option to provide the relevant keys required to execute all Twitter 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 Twitter account. Once you create an account, you can use it to execute all other Twitter actions and triggers.

Once you have entered all the details, click on SAVE to save your trigger.

twitter_post.PNG


This will create the specified trigger on webMethods.io Integration and redirect you to the Test trigger window, where you can check if you have configured the trigger settings properly.

Step 3.2 Test the configured trigger

To test your trigger, you need to perform the trigger event in the web service account for which you have set up the trigger (these instructions can be seen in the Test trigger window as well). For this example, go to your Twitter account and post a new tweet.

twitter_test.PNG


Once this is done, go back to your canvas in webMethods.io Integration and click on the Test button given at the bottom of the Test trigger form webMethods.io Integration will now fetch the data of the tweet that you just posted on your Twitter account.

If you have configured the trigger correctly, you will see the output data for the trigger. This will give you an idea of how your trigger will work when used in a workflow and which keys are returned in the output of the trigger. This output data will then be used to configure the rest of the workflow.

1-twitter-test-data.png


Alternatively, if you don’t want to test the trigger, you can click the Skip button.

twitter_test.PNG


If you Skip testing the trigger, webMethods.io Integration will use the mock data for that trigger to configure the rest of the workflow.

tt.PNG


Step 3.3 Setting up filters for your trigger

You can also set custom filters to specify the conditions which must be met in order to execute the workflow. To do this, click on the filters link given at the bottom of the trigger output.

You will be redirected to the Filters window where you can set up conditions. Click here to know more about how to set up conditions with filters

11-add-filter.png


Once you have entered all the details, click on DONE. And that’s it! Your Twitter – New Tweet or Retweet Posted by Me trigger has been configured.

When you return to the canvas, you will notice that the start icon has now been replaced with the Twitter icon. This confirms that the Twitter trigger has been set up properly.

Let us now set up the action.

Step 4: Set up action

For this example, we need to set up the Slack – Post Message to Channel action, which automatically posts contents of the tweet to the specified Slack channel. Here’s how to do it:

Step 4.1. Drag-and-drop connector on canvas

On the right-hand side of the canvas, under Connectors, look for Slack, and drag-and-drop it anywhere on the canvas. You will see that it gets automatically connected to the Start icon (which is now Twitter icon).

slack-final.gif

Step 4.2. Configure Slack - Post Message to Channel action

Double-click on the Slack connector icon. A pop-up window will appear on screen where you can see the configuration form for the Slack actions. 

For our example, we need to configure the Slack - Post Message to Channel action. To do so, provide values for the input fields as instructed below:

Select Action:
Select Post Message to Channel action from the list of supported Slack actions.

Label:
Provide a suitable name for this action (E.g., Post Message on Slack)

Authorize Slack:
Click the '+' icon to add a Slack authorization.

1-slack-auth.png

If you are already logged in to your Slack account, you will be prompted to grant webMethods.io Integration the permission to access your Slack account. Click Allow. (If you are not logged in, you will be prompted to login first.)

2-allow-slack.png

On the next screen you will be prompted to install the webMethods.io Integration app for your Slack workspace. Click Install.

3-install.png

 This will redirect you back to canvas. A dialog box will appear where you can optionally change the name of the account you are about to create. Once this is done, click Add.

4-add-account.png

With this, your Slack account is successfully created. You can now use this account to configure any Slack triggers or actions.

After this, click Next

5-added-account.png


This will redirect you to the Post Message to Channel action configuration window.

Configure the Post Message to Channel action as per the instructions given below:

To: Specify the type of the channel on which you want to post the tweet details.

Public Channel ID or Channel Name: Select/specify the channel ID or channel name on which you want to post the tweet details.

Text: Since we want to post the content of the tweet as a message on a channel, we can pass the output of the Twitter - New Tweet or Retweet Posted by Me trigger in this field. The output of the trigger is visible on the left-hand side of the window, under the {trigger_name} - Trigger Data field. When you click on the drop-down arrow given beside the trigger name, you can see the list of trigger output keys along with the sample output values retrieved from the previous trigger test execution.
From the trigger output list, select the text parameter for the Text field. This will include the content (text) of the tweet in the message body when the workflow is executed.

6-slack-text.png


Once you have entered all the details, click Next. This will take you to the Test action window, where you can check if you have configured the action correctly.

Step 4.3. Test the configured Slack - Post Message to Channel action

In the Test action window, you can see two tabs: INPUT and OUTPUT. By default, the INPUT tab is open which displays the input details you have entered for the Slack - Post Message to Channel action. 

Scroll down and click on the Test button to check if you have configured the action properly.

7-slack-test.png

When you click on the Test button, webMethods.io Integration will post a message containing the tweet on the specified Slack channel, and will show the output of this action in the window that appears. 

This lets you check whether the action is working as expected and also fetches the sample output for this action, which can be used while setting up the next actions.

8-slack-test-output.png

Just like trigger, you can optionally set up filters for your actions. The process to set up filters for actions remains same as explained in step 3.3. Once you have entered all the details, click on Done. This will take you back to canvas.

Step 5: Complete and save your workflow

Your workflow is not complete until you:

  • Connect the last action to the Stop icon
  • Save your workflow

With this, you have successfully created your first workflow. It is now time to test it.

Step 6: Trigger your workflow

To trigger the workflow, we will reproduce the trigger event that we defined in our workflow. In other words, we will post a new tweet on Twitter, which should trigger our workflow.

To do this, log in to your Twitter account, and post a tweet.

As soon as you do this, the workflow will be executed. Note that some trigger events may take time to trigger the workflow (Read types of triggers).

You will see the real-time visualization of the progress of your workflow. This will all happen in a matter of seconds. Once the workflow is completed, check the specified Slack channel. You must have received a message containing the tweet.

Now that you know the basics of creating a workflow, read our Additional Features section to learn about the various tools that you can use to further customize your workflows.