n8n Workflow

Post Rss Feed Items From Yesterday To Slack

This n8n workflow automates tasks using Slack. Post Rss Feed Items From Yesterday To Slack - ready to import and run in your n8n instance.

n8n workflow.json

About This Script

This n8n workflow automates tasks using Slack. Post Rss Feed Items From Yesterday To Slack - ready to import and run in your n8n instance.
Features:
  • Custom JavaScript function processing
  • Scheduled automation with cron triggers
  • Conditional logic and branching
  • Integrates with Slack
Source Code
{
    "nodes": [
        {
            "name": "Build our message",
            "type": "n8n-nodes-base.function",
            "position": [
                1160,
                400
            ],
            "parameters": {
                "functionCode": "// Create our Slack message\n// This will output a list of RSS items in the following format\n// Title - Description\nlet message = \"*:new: Posts from yesterday :new:*\\n\\n\";\n\n// Loop the input items\nfor (item of items) {\n  message += \"*<\" + item.json.link + \"|\" + item.json.title + \">*\\n\" + item.json.contentSnippet + \"\\n\\n\"; \n}\n\n// Return our message\nreturn [{json: {message}}];"
            },
            "typeVersion": 1,
            "id": "8436cdd4-f8c3-432c-8739-aa3c38eb9c3e"
        },
        {
            "name": "Every Morning",
            "type": "n8n-nodes-base.cron",
            "position": [
                380,
                420
            ],
            "parameters": {
                "triggerTimes": {
                    "item": [
                        {
                            "hour": 8
                        }
                    ]
                }
            },
            "typeVersion": 1,
            "id": "5cd0b568-b265-4721-9365-26bd46cf7dc1"
        },
        {
            "name": "Get Yesterdays Date",
            "type": "n8n-nodes-base.dateTime",
            "position": [
                560,
                420
            ],
            "parameters": {
                "value": "={{Date()}}",
                "action": "calculate",
                "options": [],
                "duration": 1,
                "operation": "subtract"
            },
            "typeVersion": 1,
            "id": "a44a023d-b97f-4235-9e77-86836eeabea8"
        },
        {
            "name": "Get the RSS Feed",
            "type": "n8n-nodes-base.rssFeedRead",
            "position": [
                740,
                420
            ],
            "parameters": {
                "url": "https://n8n.io/blog/rss"
            },
            "typeVersion": 1,
            "id": "27027c0d-fa30-466b-abd5-83c477ac231e"
        },
        {
            "name": "If it was published after yesterday",
            "type": "n8n-nodes-base.if",
            "position": [
                940,
                420
            ],
            "parameters": {
                "conditions": {
                    "dateTime": [
                        {
                            "value1": "={{$item(0).$node[\"Get Yesterdays Date\"].json.data}}",
                            "value2": "={{$json[\"pubDate\"]}}",
                            "operation": "before"
                        }
                    ]
                }
            },
            "typeVersion": 1,
            "continueOnFail": true,
            "id": "b5854730-9fd5-401b-95c7-bc485ed4e3bc"
        },
        {
            "name": "Post to Slack",
            "type": "n8n-nodes-base.slack",
            "position": [
                1340,
                400
            ],
            "parameters": {
                "text": "={{$json[\"message\"]}}",
                "channel": "#news",
                "blocksUi": {
                    "blocksValues": []
                },
                "attachments": [],
                "otherOptions": []
            },
            "credentials": {
                "slackApi": {
                    "id": "53",
                    "name": "Slack Access Token"
                }
            },
            "typeVersion": 1,
            "id": "840244cd-ab47-4cf0-8c9e-152b1a22d8f1"
        }
    ],
    "connections": {
        "Every Morning": {
            "main": [
                [
                    {
                        "node": "Get Yesterdays Date",
                        "type": "main",
                        "index": 0
                    }
                ]
            ]
        },
        "Get the RSS Feed": {
            "main": [
                [
                    {
                        "node": "If it was published after yesterday",
                        "type": "main",
                        "index": 0
                    }
                ]
            ]
        },
        "Build our message": {
            "main": [
                [
                    {
                        "node": "Post to Slack",
                        "type": "main",
                        "index": 0
                    }
                ]
            ]
        },
        "Get Yesterdays Date": {
            "main": [
                [
                    {
                        "node": "Get the RSS Feed",
                        "type": "main",
                        "index": 0
                    }
                ]
            ]
        },
        "If it was published after yesterday": {
            "main": [
                [
                    {
                        "node": "Build our message",
                        "type": "main",
                        "index": 0
                    }
                ]
            ]
        }
    },
    "n8n_version": "1.5.0"
}
Requirements
n8n instance, Slack API credentials
Tags
#n8n #automation #workflow
Quick Actions
More in n8n Workflows