GitHub Integration Workflow
Let's build a GitHub automation system that:
- Automatically triages and classifies new issues
- Intelligently assigns labels based on content
- Suggests appropriate assignees and reviewers
- Monitors PR test status
- Generates contextual comments
Workflow Structure
The GitHub integration workflow is organized into two main components:
- Issue Triage: Handles the management of GitHub issues
- PR Classifier: Manages pull request workflows
The Steps
<Tabs items={['issue-webhook', 'issue-classifier', 'label-assigner', 'assignee-selector']}>
<Tabs items={['pr-webhook', 'pr-classifier', 'pr-reviewer', 'pr-monitor']}>
Visual Overview
Here's how the automation flow works:


- Webhook Reception → Captures GitHub events
- Issue/PR Classification → Analyzes content with AI
- Automated Labeling → Applies appropriate labels
- Smart Assignment → Suggests reviewers and assignees
- Status Monitoring → Tracks PR test status
Try It Out
Prerequisites
Make sure you have:
- GitHub account with personal access token
- Node.js installed
- OpenAI API key (for AI classification)
Clone the Repository
git clone git@github.com:MotiaDev/motia-examples.git
cd examples/github-integration-workflow
Install Dependencies
npm install
Configure Environment Variables
Create a .env file by copying the example:
cp .env.example .env
Update your .env with the following credentials:
GITHUB_TOKEN=your_github_token_here
OPENAI_API_KEY=your_openai_api_key
Set Up GitHub Webhook
- Go to your GitHub repository settings
- Navigate to Webhooks and add a new webhook
- Set the Payload URL to your Motia server endpoint
- Select content type as
application/json - Choose which events to trigger the webhook (Issues, Pull requests)
- Save the webhook
Run the Application
npm run dev
Test the Flow
- Create a new issue in your GitHub repository
- Watch as it gets automatically classified and labeled
- Create a new PR to see the reviewer assignment in action
- Check the PR comments for test status updates