/ Impact Agent.md
Impact Agent.md
 1  ---
 2  type: make-scenario-migration
 3  status: pending
 4  make-id: 4267671
 5  active: false
 6  invalid: false
 7  trigger: supabase
 8  apps: [supabase, http]
 9  executions: ~low
10  last-edit: 2026-04-05
11  ---
12  
13  # Impact Agent
14  
15  **Status:** INACTIVE
16  **Make ID:** 4267671
17  **Trigger:** Supabase → Watch Events (row insert/update)
18  
19  ---
20  
21  ## Module Sequence
22  
23  1. **Supabase — Watch Events** → triggers on database events (likely a specific table, e.g., `pipeline_documents` or `impact_submissions`)
24  2. **Supabase — Search Rows** → searches `clients` table by slug to retrieve client record
25  3. **HTTP — PATCH** → calls Supabase REST API directly to update a row in `pipeline_documents` table with:
26     - `status` — new status value
27     - `notes` — review notes
28     - `reviewed_at` — timestamp
29     - `reviewed_by` — reviewer identifier
30  
31  ---
32  
33  ## n8n Node Mapping
34  
35  | Make Module | n8n Node | Notes |
36  |---|---|---|
37  | Supabase Watch Events | Webhook node | Supabase Database Webhooks (Realtime) → POST to n8n URL |
38  | Supabase Search Rows | HTTP Request | GET `{supabase_url}/rest/v1/clients?slug=eq.{slug}` with `apikey` header |
39  | HTTP PATCH (Supabase REST) | HTTP Request | PATCH `{supabase_url}/rest/v1/pipeline_documents?id=eq.{id}` |
40  
41  ---
42  
43  ## Key Details
44  
45  - Supabase Watch Events in Make uses Supabase Realtime or Database Webhooks — in n8n, use Supabase's **Database Webhooks** feature (set n8n Webhook URL as the target in Supabase Dashboard → Database → Webhooks)
46  - Supabase credential needs: project URL + service_role API key (for read/write access)
47  - This appears to be part of an internal "Impact Agent" review workflow — likely used for reviewing/approving client pipeline documents
48  - The direct PATCH via HTTP Request (rather than Supabase node) suggests a specific table/column structure — retrieve the exact PATCH body from the blueprint
49  
50  ---
51  
52  ## Migration Checklist
53  
54  - [ ] Identify the Supabase project URL and which table triggers this (likely `pipeline_documents`)
55  - [ ] Set up Supabase Database Webhook → n8n URL in Supabase Dashboard
56  - [ ] Add Supabase API key (service_role) as credential in n8n
57  - [ ] Build workflow: Webhook → HTTP Request (search clients) → HTTP Request (PATCH pipeline_documents)
58  - [ ] Retrieve exact PATCH body fields from Make blueprint
59  - [ ] Test with a sample database event
60  - [ ] Confirm `pipeline_documents` row updated correctly
61  - [ ] Mark active when Impact Agent workflow is relaunched