|
| 1 | +# Inbound Intake — Operations Guide |
| 2 | + |
| 3 | +## Overview |
| 4 | + |
| 5 | +The **Inbound Intake** system normalizes all incoming work (GitHub webhooks, Telegram messages, scheduled polls) into a standard `work_item` schema before processing. This ensures every platform is treated uniformly regardless of its native format. |
| 6 | + |
| 7 | +## Architecture |
| 8 | + |
| 9 | +``` |
| 10 | +[External Platform] → [Webhook/Poller] → [Normalize] → [Create GitHub Issue] → [SIN-Hermes Dispatch] |
| 11 | +``` |
| 12 | + |
| 13 | +## Prerequisites |
| 14 | + |
| 15 | +- n8n running on OCI VM (`http://92.5.60.87:5678`) |
| 16 | +- GitHub Personal Access Token with repo scope |
| 17 | +- `inbound-intake` workflow activated in n8n |
| 18 | + |
| 19 | +## Workflow: `inbound-intake` |
| 20 | + |
| 21 | +### Trigger |
| 22 | +Webhook POST to `http://92.5.60.87:5678/webhook/inbound-work` |
| 23 | + |
| 24 | +### Body Schema |
| 25 | +```json |
| 26 | +{ |
| 27 | + "source": "prolific|hackerone|upwork|telegram|github|pr-review", |
| 28 | + "type": "bug|enhancement|survey|research", |
| 29 | + "title": "Work item title", |
| 30 | + "description": "Detailed description", |
| 31 | + "priority": "low|medium|high|critical", |
| 32 | + "metadata": {} |
| 33 | +} |
| 34 | +``` |
| 35 | + |
| 36 | +### Steps |
| 37 | +1. **Webhook** receives incoming payload |
| 38 | +2. **Normalize Work Item** → transforms to canonical schema |
| 39 | +3. **Create GitHub Issue** → opens issue in target repo with type label |
| 40 | +4. **Log to Supabase** → records work item for tracking |
| 41 | + |
| 42 | +## PR-Watcher: `watch-pr-feedback.sh` |
| 43 | + |
| 44 | +Runs as a cron job every 5 minutes: |
| 45 | + |
| 46 | +```bash |
| 47 | +*/5 * * * * /Users/jeremy/dev/OpenSIN-documentation/scripts/watch-pr-feedback.sh |
| 48 | +``` |
| 49 | + |
| 50 | +Monitors: |
| 51 | +- New PRs in `OpenSIN-AI/*` org |
| 52 | +- PR reviews and comments |
| 53 | +- Issue updates |
| 54 | + |
| 55 | +## File Locations |
| 56 | + |
| 57 | +| File | Path | |
| 58 | +|------|------| |
| 59 | +| n8n workflow | `n8n-workflows/inbound-intake.json` | |
| 60 | +| Governance config | `governance/repo-governance.json` | |
| 61 | +| PR watcher script | `scripts/watch-pr-feedback.sh` | |
| 62 | +| Operations doc | `docs/03_ops/inbound-intake.md` | |
| 63 | + |
| 64 | +## Troubleshooting |
| 65 | + |
| 66 | +### n8n workflow not triggering |
| 67 | +- Check workflow is **activated** in n8n |
| 68 | +- Verify webhook URL is correct in platform config |
| 69 | +- Check n8n logs: `http://92.5.60.87:5678/execution` |
| 70 | + |
| 71 | +### GitHub issue not created |
| 72 | +- Verify PAT has `repo` scope |
| 73 | +- Check workflow execution in n8n |
| 74 | +- Ensure `owner`/`repo` fields are set in workflow |
| 75 | + |
| 76 | +### PR watcher not running |
| 77 | +```bash |
| 78 | +# Check cron status |
| 79 | +crontab -l |
| 80 | + |
| 81 | +# Manual run |
| 82 | +bash /Users/jeremy/dev/OpenSIN-documentation/scripts/watch-pr-feedback.sh |
| 83 | +``` |
| 84 | + |
| 85 | +## Activation |
| 86 | + |
| 87 | +To activate for a new repo: |
| 88 | + |
| 89 | +1. Copy `governance/repo-governance.json` to the repo's `governance/` directory |
| 90 | +2. Import `n8n-workflows/inbound-intake.json` into n8n |
| 91 | +3. Configure webhook URL in the source platform |
| 92 | +4. Set up cron: `*/5 * * * * /path/to/watch-pr-feedback.sh` |
| 93 | + |
| 94 | +## Agent |
| 95 | + |
| 96 | +`assistant/api` (this session) |
| 97 | +Generated: 2026-04-17 |
0 commit comments