webMethods.io Integration workflow: Request data from a source and regularly send an email with the content

Overview

This tutorial describes a webMethods.io Integration workflow which is triggered at a certain time, and it’s used to send an email to respective audience with requested data from Discourse platform.

We use this example to remind our moderators once a week about unanswered topics on our platform. In the Discourse community platform, such functionality is missing and using webMethods.io Integration to create it turned out to be much easier than developing a Discourse plugin.

Note
Currently there is no webMethods.io connector for Discourse. For workflows which work together with Discourse we are using their great API. This means that the below example will work with any application (not just Discourse) that has an API you can access.

Steps

  1. Login to your webMethods.io Integration tenant or sign up for a free trial if you’re new.

  2. Create a new project or choose an existing one.

  3. Go ahead and get started by creating a blank workflow. If you need a refresher on how to get to this point, this guide can be a great introduction.

  4. If you want the workflow to be triggered periodically, you can do this by using polling triggers.

    In this example, we will use Clock trigger and set an email to be sent every week.

    Click on the small setting icon on the Start step and choose Clock trigger. Use the edit option to choose a day and time and click Done.

    As an example, we’ll set it every Monday at 1 AM:

  5. Add the HTTP Request service to the canvas with the drag and drop feature. This automatically connects with the Clock trigger.

  6. Click on the small settings icon on the HTTP Request service to select HTTP Method and add an URL (in our case, Discourse API endpoint which provides a list of unanswered topics for a specified category):

    HTTP method: GET
    URL: https://{defaultHost}/tags/c/category-name/category-id.json?max_posts=1

    Click Next and then Done to save the HTTP request.

  7. If you want to create a custom HTML email template, use the Node.js service and add it to the canvas using the drag and drop feature. Design your HTML code and connect it to the HTTP Request service.

    image image

  8. For this tutorial, we’ll use the Send an email feature to send the content to the respective audience. Search for Send an email connector on the right hand panel and drag and drop it to the canvas.

  9. Fill out the required fields in the Send an Email service.

    Click Done and connect the Send an email action with the end point.

  10. Save the workflow.

  11. Run the workflow (the play button next to Save) to review the email and the results of the workflow.

1 Like