Set up an 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:

Drag-and-drop the 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).

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 (for example, Post Message on Slack).

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

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

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

This will redirect you back to the 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.

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.

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

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.

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.

Note:
  • Testing a Logger action is supported up to 256 KB. If you test a Logger action with data greater than 256 KB, you will get a “Message size too large” error.
  • Testing any other action is supported up to 512 KB. If you test any action with data greater than 512 KB, you will get a “Message size too large” error.
  • To copy-paste the paths and values of input or output data, hover your mouse over the required data, click on the three dots, and then select Copy value or Copy path options based on your requirements.

When you click on the Test button, IBM webMethods 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.

Skip Test

Click Skip if you prefer not to wait for the test action output to display. When you select Skip, the system continues testing the action in the background, allowing you to navigate to the next screen seamlessly.

After completing the workflow configuration, you can save and reopen the workflow to view the output from the tested action.

Note:

If you skip testing an action for the first time and later use that action's output keys in a subsequent action, you will encounter an error during the second action's test. This occurs because skipping the test prevents the system from generating the necessary output data, making it unavailable for any following actions.

Additionally, if you skip retesting an action after changing its inputs and then use that action’s output keys in a subsequent action, the system will use the old output data from the first action to test the second action.

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