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
Automate GitHub lookup with Slack and n8n

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

Learn how to Build this Workflow with AI:

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.


Automate GitHub lookup with Slack and n8n

Visit through Desktop to Interact with the Workflow.

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 Twist Channel Creation and Messaging with n8n

This workflow automates creating and updating a channel in Twist and sending a personalized message to specific users. It eliminates manual setup errors and saves time managing Twist communications.

Automate Ideogram Image Generation with Google Sheets & Gmail

This workflow automates graphic design image generation via Ideogram AI, storing image data in Google Sheets and Google Drive, with email alerts via Gmail. It saves designers hours by automating image creation, remixing, review, and record-keeping.

Automate IT Support with Slack and OpenAI in n8n

Streamline IT support by automating Slack message handling using n8n and OpenAI. This workflow handles Slack DMs, filters bots, queries a Confluence knowledge base, and delivers AI-generated responses, improving support efficiency and response time.

Automate Crypto Analysis with CoinMarketCap & n8n AI Agent

Discover how this unique n8n workflow leverages CoinMarketCap’s multi-agent AI to deliver precise, real-time cryptocurrency insights directly via Telegram. Manage crypto data analysis efficiently with automated multi-source API integration.

Automate Gumroad to Beehiiv Subscriber Sync with n8n

Learn how to automatically add new Gumroad sales customers as Beehiiv newsletter subscribers using n8n automation. This workflow saves time by syncing sales data to Google Sheets CRM and notifying your Telegram channel instantly.

Generate On-Brand Blog Articles Using n8n and OpenAI

This workflow automates the creation of on-brand blog articles by analyzing existing company content using n8n and OpenAI. It extracts article structures and brand voice to produce consistent draft articles, saving significant content creation time.
1:1 Free Strategy Session
Your competitors are already automating. Are you still paying for it manually?

Do you want to adopt AI Automation?

Every hour your team does repetitive work, you're burning real money.
While you wait, faster businesses are cutting costs and moving quicker.
AI and automations aren't the future anymore — they're the present.

Book a live 1-on-1 session where we show you exactly which of your daily tasks can be automated — and what it’s costing you not to.