Automate GitHub User Info Lookup via Slack & n8n

Discover how this n8n workflow automates fetching GitHub user details through Slack commands, saving developers time and avoiding manual copying errors. Quickly retrieve emails, company, location, and avatar data in your Slack channel.
webhook
graphql
function
+1
Workflow Identifier: 1603
NODES in Use: Webhook, GraphQL, Function, Slack

Press CTRL+F5 if the workflow didn't load.

Learn how to Build this Workflow with AI:

Visit through Desktop for Best experience

What this workflow does

This workflow gets detailed GitHub user information fast. It solves the problem of slow, manual searching for contact data. The result is a quick Slack message with user name, emails, company, location, and avatar.

The workflow saves time by automating data fetching and sharing inside Slack.


Who should use this workflow

This is for anyone needing GitHub user details quickly while chatting in Slack. It suits teams that contact developers often and want to avoid manual lookup. It helps project managers, team leads, or support who want fast verified emails.


Tools and services used

  • n8n automation platform: Runs the workflow for integrations.
  • Slack API: Receives commands and posts messages in channels.
  • GitHub GraphQL API: Gets user profile data and commit emails.

Inputs → Processing → Output

Input

The input is a Slack slash command with a GitHub username as text.

Processing

The workflow uses the username to query GitHub’s GraphQL API.

It gathers profile info like real name, company, location, avatar URL, and public email.

It also reads the last 25 pull requests by the user to find commit author emails.

Emails are filtered to remove duplicates and GitHub no-reply addresses.

Output

The workflow posts a formatted Slack message in the channel.

The message shows name, verified emails, company, location, and the user’s avatar.


Beginner step-by-step: How to use this workflow in n8n

Step 1: Import the workflow

  1. Download the workflow file from this page.
  2. Open your n8n editor.
  3. Click on the menu and select Import from File.
  4. Choose the downloaded workflow file to add it.

Step 2: Configure the credentials

  1. Open the GraphQL node and enter your GitHub personal access token with GraphQL permissions.
  2. Open the Slack node and connect OAuth2 credentials for your Slack app.

Step 3: Update IDs if needed

  1. Check if the Slack channel ID matches your workspace.
  2. If you want messages in a different channel, update the channel ID in the Slack node.

Step 4: Test the workflow

  1. Run the slash command in Slack, for example: /githubuser octocat.
  2. Confirm the workflow receives the username and fetches the data.
  3. Check Slack for the formatted message with user info.

Step 5: Activate the workflow

  1. Turn on the workflow’s Active switch inside n8n.
  2. Keep the webhook URL available for Slack POST calls.
  3. Your team can now get GitHub user info quickly via Slack commands.

For self hosting n8n, use self-host n8n to keep the workflow running reliably.


Code used in the Function node to extract emails

This JavaScript code gathers and cleans emails from GitHub API response data.

let emails = [];
let tempEmails = [];
const name = $node["GraphQL"].json["data"]["data"]["user"]["name"];
const publicEmail = $node["GraphQL"].json["data"]["data"]["user"]["email"];
const username = $node["Webhook"].json["body"]["text"];
const nameRegex = new RegExp(name,"g")

if(publicEmail){
  tempEmails.push(publicEmail);
}

for(const edge of items[0].json.data.data.user.pullRequests.edges){
  for(node of edge.node.commits.nodes){
    if(nameRegex.test(node.commit.author.name) || node.commit.author.name == username) {
      tempEmails.push(node.commit.author.email);
    }
  }
}

emails = [...new Set(tempEmails)];

let re = /^\w+(.)*@users.noreply.github.com/;
emails = emails.filter(email => !re.test(email));

return [{json:{emails}}];

This code adds the public email if available, scans commits for matching author names or username, removes duplicates, and filters out GitHub no-reply emails.


Customization ideas

  • Change the number of pull requests scanned by updating last: 25 in the GraphQL query.
  • Add more GitHub fields like bio or Twitter username in the GraphQL node and Slack message.
  • Make Slack notify specific users by adding mentions in the message text of the Slack node.

Common problems & solutions

  • GitHub API authorization error: Generate a new personal access token with proper scopes. Update the GraphQL node’s headers.
  • Slack node authentication failed: Reconnect Slack OAuth2 credentials in n8n and check permissions.
  • No emails showing in Slack message: The Function node filters may be too strict or commit author names don’t match. Adjust regex or check commit data.

Summary of results and benefits

→ The workflow cuts GitHub user data lookup from 15 minutes to a few seconds.

→ Slack channels get verified user emails and profile info instantly.

✓ It removes manual searching and copying errors.

✓ It makes team communication faster and easier.

✓ It works fully inside n8n and Slack with simple configuration.


Frequently Asked Questions

The workflow uses a Slack command to get a username, then calls GitHub’s GraphQL API to fetch profile and commit email data.
The Function node extracts emails from public profile and recent pull requests, removes duplicates and no-reply addresses.
The workflow is built for Slack. Other platforms need custom nodes and webhook setups not included here.
Import the workflow file, add GitHub and Slack credentials, test using the Slack slash command, then activate the workflow.

Promoted by BULDRR AI

Related Workflows

Automate Viral UGC Video Creation Using n8n + Degaus (Beginner-Friendly Guide)

Learn how to automate viral UGC video creation using n8n, AI prompts, and Degaus. This beginner-friendly guide shows how to import, configure, and run the workflow without technical complexity.
Form Trigger
Google Sheets
Gmail
+37
Free

AI SEO Blog Writer Automation Workflows in n8n

A complete beginner guide to building an AI SEO blog writer automation using n8n.
AI Agent
Google Sheets
httpRequest
+5
Free

Automate CrowdStrike Alerts with VirusTotal, Jira & Slack

This workflow automates processing of CrowdStrike detections by enriching threat data via VirusTotal, creating Jira tickets for incident tracking, and notifying teams on Slack for quick response. Save hours daily by transforming complex threat data into actionable alerts effortlessly.
scheduleTrigger
httpRequest
jira
+5
Free

Automate Telegram Invoices to Notion with AI Summaries & Reports

Save hours on financial tracking by automating invoice extraction from Telegram photos to Notion using Google Gemini AI. This workflow extracts data, records transactions, and generates detailed spending reports with charts sent on schedule via Telegram.
lmChatGoogleGemini
telegramTrigger
notion
+9
Free

Automate Email Replies with n8n and AI-Powered Summarization

Save hours managing your inbox with this n8n workflow that uses IMAP email triggers, AI summarization, and vector search to draft concise replies requiring minimal review. Automate business email processing efficiently with AI guidance and Gmail integration.
emailReadImap
vectorStoreQdrant
emailSend
+12
Free

Automate Email Campaigns Using n8n with Gmail & Google Sheets

This n8n workflow automates personalized email outreach campaigns by integrating Gmail and Google Sheets, saving hours of manual follow-up work and reducing errors in email sequences. It ensures timely follow-ups based on previous email interactions, optimizing communication efficiency.
googleSheets
gmail
code
+5
Free