Remind the team about pull requests waiting for review

Every workday, post pull requests that have waited 2+ days for review to your dev channel.

Easy Saves ~2 hours/month Developer & ITBy Flowngn team

Works with n8n · Make · Zapier

How it works

Trigger: Schedule — weekdays at 10:00
  1. Get the repository's open pull requests from the GitHub API.
  2. Keep non-draft ones older than 2 days.
  3. Post them to Slack with their author and reviewers.

Diagram

Weekdays 10:00Schedule TriggerGet open pull reque…HTTP Request{ }Waiting 2+ daysCodeSRemind the teamSlack
Trigger App Code

Code

JavaScript used in the Code step — already included in the template below.

Waiting 2+ days · Code node
// Lists open, non-draft pull requests waiting 2+ days, oldest first.
const DAY = 24 * 60 * 60 * 1000;

const waiting = $input.all()
  .map((item) => item.json)
  .filter((pr) => pr.number && !pr.draft)
  .map((pr) => ({ ...pr, days: Math.floor((Date.now() - new Date(pr.created_at)) / DAY) }))
  .filter((pr) => pr.days >= 2)
  .sort((a, b) => b.days - a.days);

if (!waiting.length) return [];

const message =
  `👀 ${waiting.length} pull request${waiting.length > 1 ? "s" : ""} waiting for review:\n` +
  waiting.map((pr) => {
    const reviewers = (pr.requested_reviewers || []).map((r) => r.login).join(", ") || "no reviewer";
    return `• <${pr.html_url}|#${pr.number} ${pr.title}> by ${pr.user.login}, ${pr.days} days (${reviewers})`;
  }).join("\n");

return [{ json: { message } }];

Build it

Pick your tool — same automation, step by step.

Copy and paste straight into an n8n canvas (Ctrl+V), or download and use Import from File. Then connect your own credentials and replace every YOUR_… placeholder.

Workflow JSON
Show code (132 lines)
{
  "name": "Remind the team about pull requests waiting for review (Flowngn)",
  "nodes": [
    {
      "parameters": {
        "content": "## Remind the team about pull requests waiting for review\nEvery workday, post pull requests that have waited 2+ days for review to your dev channel.\n\n**Setup**\n1. Open each node and connect your own credentials.\n2. Replace every YOUR_… placeholder.\n3. Test once, then activate.\n\nFree template from Flowngn",
        "height": 260,
        "width": 340
      },
      "id": "26067c04-e776-42a7-a37a-b6a76afcb0f2",
      "name": "Setup notes",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -420,
        -60
      ]
    },
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "cronExpression",
              "expression": "0 10 * * 1-5"
            }
          ]
        }
      },
      "id": "26067c04-e776-42a7-a37a-b6a76afcb0f2",
      "name": "Weekdays 10:00",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [
        0,
        0
      ]
    },
    {
      "parameters": {
        "url": "https://api.github.com/repos/YOUR_ORG/YOUR_REPO/pulls?state=open&per_page=100",
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "githubApi",
        "options": {}
      },
      "id": "26067c04-e776-42a7-a37a-b6a76afcb0f2",
      "name": "Get open pull requests",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        300,
        0
      ]
    },
    {
      "parameters": {
        "jsCode": "// Lists open, non-draft pull requests waiting 2+ days, oldest first.\nconst DAY = 24 * 60 * 60 * 1000;\n\nconst waiting = $input.all()\n  .map((item) => item.json)\n  .filter((pr) => pr.number && !pr.draft)\n  .map((pr) => ({ ...pr, days: Math.floor((Date.now() - new Date(pr.created_at)) / DAY) }))\n  .filter((pr) => pr.days >= 2)\n  .sort((a, b) => b.days - a.days);\n\nif (!waiting.length) return [];\n\nconst message =\n  `👀 ${waiting.length} pull request${waiting.length > 1 ? \"s\" : \"\"} waiting for review:\\n` +\n  waiting.map((pr) => {\n    const reviewers = (pr.requested_reviewers || []).map((r) => r.login).join(\", \") || \"no reviewer\";\n    return `• <${pr.html_url}|#${pr.number} ${pr.title}> by ${pr.user.login}, ${pr.days} days (${reviewers})`;\n  }).join(\"\\n\");\n\nreturn [{ json: { message } }];"
      },
      "id": "26067c04-e776-42a7-a37a-b6a76afcb0f2",
      "name": "Waiting 2+ days",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        600,
        0
      ]
    },
    {
      "parameters": {
        "select": "channel",
        "channelId": {
          "__rl": true,
          "value": "#dev",
          "mode": "name"
        },
        "text": "={{ $json.message }}",
        "otherOptions": {}
      },
      "id": "26067c04-e776-42a7-a37a-b6a76afcb0f2",
      "name": "Remind the team",
      "type": "n8n-nodes-base.slack",
      "typeVersion": 2.2,
      "position": [
        900,
        0
      ]
    }
  ],
  "connections": {
    "Weekdays 10:00": {
      "main": [
        [
          {
            "node": "Get open pull requests",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get open pull requests": {
      "main": [
        [
          {
            "node": "Waiting 2+ days",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Waiting 2+ days": {
      "main": [
        [
          {
            "node": "Remind the team",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "meta": {
    "templateCredsSetupCompleted": false
  },
  "tags": []
}

Open in the playground to edit →

Tips

  • Use a fine-grained GitHub token with read-only access to pull requests.

Related flows