webMethods.io Integration workflow: Detect spam forum posts with ChatGPT connector

Overview

A simple workflow example of how to use ChatGPT webMethods.io Integration connector to filter spam messages.

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. In the workflows tab, add a new Workflow.
  4. The first step is to set a RSS feeds trigger which will automatically start the workflow once a new post is submitted to the TECH forums.

Hover over the Start step and click the gear icon. Find the RSS feeds trigger and configure it – enter RSS Feed URL and perform a test.

  1. Next, search for the ChatGPT connector and add it to the canvas. To configure it provide your API key and fill out all necessary fields – use the prompt field to ask ChatGPT anything.

In this example the ChatGPT connector setup looks like this:

Model: text-davinci-003
Prompt: Does this post in the Software AG Tech Community support forum sound like spam?
{{$trigger.description}} (from the Incoming data panel add the post content fetched by the RSS feeds trigger)
max_tokens: 35

  1. Then you can choose what are the next steps if the post is defined by ChatGPT as spam.

Add two arrows that come out of the ChatGPT connector. Hover over the first one and click the gear icon. Then set up a condition if the ChatGPT answer matches ‘Yes’. Connect the arrow to the next action.

This example sends a POST API request to Discourse API (the platform behind the TECH forums) which flags the post as spam, hides it and sends it to the review queue. The HTTP Request connector setup looks like this:

HTTP method: Post
URL: https://{defaultHost}/post_actions.json
Headers:

Key: Api-Username
Value: username

Key: Api-Key
Value: key

Set Body Type: x-www-form-urlencoded
Body:

Name: id
Value: get the post id from the Incoming data panel

Name: post_action_type_id
Value: 8

If the post is not spam, set up a condition if the ChatGPT answer matches ‘no’ and connect the second arrow to the Stop step – this will leave the post as it is.

Useful resources

You can register for an OpenAI account from here: https://platform.openai.com/overview. After you login, you will need to upgrade your account and create an API key from your account menu.

To learn more about how you can integrate the webMethods.io ChatGPT API Connector with any application, you can watch our demos (we show the steps on how to register for an OpenAI account and create several workflows from scratch):

This post is a part of the Generative AI (ChatGPT) Augmenting Human Capabilities iPaaS Puzzle! - everyone is invited to solve an iPaaS puzzle and help build a library of great workflows that can help make our lives easier.

1 Like