DEV Community

Cover image for Learning n8n by Doing: First Case Study - Slack to Dev.to
Youvandra Febrial
Youvandra Febrial

Posted on

Learning n8n by Doing: First Case Study - Slack to Dev.to

Automating Article Creation from Slack to Dev.to with n8n + AI

Let’s start with a case study.

I received this challenge from an Upwork job posting, and I decided to learn by actually building it.

The workflow is simple but powerful:

  1. Take prompts from Slack (#prompt channel)
  2. Run them through an AI model
  3. Generate article text
  4. Send to Slack for review, if approved →
  5. Publish the article to Dev.to

Step 1: Create the Workflow

First, create a new workflow and add your first step.

Add your first step

Choose On App Event and select the Slack trigger.

On App Event

Slack Trigger

Trigger


Step 2: Set Up Slack Credentials

You’ll need two things:

  • Access Token
  • Signature Secret

Go to the Slack App Dashboard and:

  1. Create a new app → From Scratch
  2. Name it (e.g. n8n Trigger) and select your workspace
  3. Fill your Slack credentials back in the Slack Trigger node

Get Access Token

Access Token

Add scope so that n8n can access Slack:

Scope Bot

Install the Bot User OAuth Token in your workspace and grant access to the required channel:

Select channel

Get Signature Secret

Signin Secret

Enable Event Subscriptions and add the n8n Webhook URL to the request URL:

Webhook URL to Request URL

Finally, choose the channel and add your app:

Choose channel

Add app


Step 3: Test the First Node

Once configured, you’ll see your first node ready:

First node

Test it to ensure Slack messages are being captured:

Test first node


Step 4: Add AI Node

Next, let’s transform Slack prompts into articles.

  • Add a Basic LLM Chain node
  • Create your article prompt
  • Use Slack message as the article topic
  • Connect it with your AI model (I used Groq in this case)

Input prompt to create Article

Prepare to add model


Step 5: Slack Approval Flow

Add a Slack Action Node to send the AI output for approval.

Add Slack action node

Fill the parameters like this:

Slack node params

In Slack, it will look like this:

Approve or Decline


Step 6: Add IF Node

To handle approval/rejection, add an IF Node:

Add IF node

Set the condition:

Condition params


Step 7: Prepare Dev.to API

To publish on Dev.to, use their REST API:

Endpoint:

https://dev.to/api/articles

Request Sample:

{
  "article": {
    "title": "string",
    "body_markdown": "string",
    "published": false,
    "series": "string",
    "main_image": "string",
    "canonical_url": "string",
    "description": "string",
    "tags": "string",
    "organization_id": 0
  }
}
Enter fullscreen mode Exit fullscreen mode

Before sending, fix the JSON payload using an Edit Fields (Set) Node:
Set Node

  • Slack prompt → article title
    Prompt as a title

  • AI output → body_markdown
    AI chat as a body_markdown
    (You can customize other params as needed.)

Step 8: Publish to Dev.to

Finally, add an HTTP Request Node to send the article to Dev.to.
Add HTTP Request node

  1. Go to Dev.to Settings → Extensions
  2. Generate a new API Key
  3. Add the key in your HTTP Request headers

params

Final Thoughts

🎉 That’s it! You’ve now built a fully automated pipeline that:

  • Captures prompts from Slack
  • Generates articles with AI
  • Routes them for approval
  • Publishes directly to Dev.to

Top comments (0)