Back to docs
API Reference

Connect Koji to n8n: Build Self-Hosted Customer Research Pipelines

Wire Koji into n8n with the REST API to build self-hosted pipelines that route every completed interview into Notion, Linear, Slack, your CRM, or any other system — without sending data through a third-party automation cloud.

TL;DR: Connect Koji to n8n and every completed AI interview can trigger a custom self-hosted workflow: create a Linear ticket from a low-quality-score conversation, route Enterprise-segment feedback to a Slack channel, append the transcript to a Notion database, score sentiment in a CRM record, or fan out to a dozen downstream tools at once. Setup takes about 15 minutes: add a Schedule Trigger in n8n, call the Koji read endpoint with an HTTP Request node, keep the interviews that have finished and been analysed, and map the payload into any of n8n's 400+ integrations. The big advantage over Zapier or Make is data residency: n8n runs on infrastructure you control, so interview transcripts never leave your stack.


Why n8n + Koji Is a Powerful Combination

Most research automation platforms (Zapier, Make) live in a vendor cloud. That is fine for marketing automation but creates a real problem for customer interview data, which often contains PII, business-sensitive feedback, and direct customer quotes that compliance teams want on infrastructure the organization owns.

n8n is the leading open-source workflow automation platform. You can self-host it on your own Kubernetes cluster, a single VPS, or even a Raspberry Pi for personal projects, and your data never traverses a SaaS automation vendor. It still gives you 400+ pre-built integrations — Notion, Linear, Jira, Slack, HubSpot, Salesforce, Airtable, Google Sheets, Postgres, S3, and so on — and a drag-and-drop visual editor.

Combining n8n with Koji's API-driven AI research platform gives you the best of both worlds:

  • AI-native research collection — Koji runs the conversational interview, transcribes voice, scores quality, extracts themes, and exposes a fully analyzed payload on the read endpoint the moment each interview completes.
  • Self-hosted routing logic — n8n decides where the data goes, how it is filtered, what it is enriched with, and which downstream systems are notified.

Traditional research platforms (SurveyMonkey, Qualtrics) cannot do this — they offer at most a "send to email" notification. Tools like Koji are designed API-first, which is why a five-node n8n workflow can replace a thousand-dollar custom integration project.


Prerequisites

Before you start:

  1. A running n8n instance. Either self-hosted (Docker, Kubernetes, or the official npm package) or n8n Cloud. The Webhook node works identically in both.
  2. A Koji project with at least one published study. Create one if you have not — the free plan includes enough credits to run a test interview.
  3. A Koji API key. Generate from Settings → API Keys → Create API Key in the Koji web app. Store it in n8n's credentials manager.
  4. A target destination tool. For this guide we walk through Notion + Linear + Slack, but the same pattern works for any n8n node.

Architecture: How the Pipeline Works

Participant completes Koji interview
        │
        ▼
Koji analysis pipeline runs (quality score, themes, structured answers, sentiment)
        │
        ▼
n8n Schedule Trigger polls GET /api/v1/interviews/{id} for pending interviews
        │
        ▼
n8n keeps the ones that are completed with analysis present
        │
        ▼
n8n routes by quality/sentiment/segment via IF / Switch nodes
        │
        ├─→ Notion: append page with transcript + themes
        ├─→ Linear: create ticket if quality_score < 3 (low signal needs review)
        ├─→ Slack: alert the CS team for Enterprise segment
        └─→ HubSpot: enrich the contact record with sentiment

The whole flow is fully asynchronous. Koji does not block waiting for n8n to finish, and n8n can fan out to dozens of destinations in parallel.


Step 1: Create the n8n Schedule Trigger

Koji has no outbound webhooks yet, so n8n pulls rather than waiting to be pushed. In your n8n canvas:

  1. Click Add first step → choose Schedule Trigger.
  2. Set the interval to every minute, or every 15 minutes if near real time is not needed.
  3. Add an HTTP Request node: GET https://www.koji.so/api/v1/interviews/{{ $json.interview_id }} with an Authorization: Bearer YOUR_KOJI_API_KEY header.
  4. Feed it the interview ids you stored when the interviews were started, from a Postgres node, a Redis node, or n8n's own static data.
  5. Click Test step to capture a sample payload.

If your interviews run in the embed widget, the browser's koji:interview_completed event is a faster signal you can forward to an n8n Webhook node of your own. Polling stays the safety net.


Step 2: Create a Koji API key

Switch to the Koji web app:

  1. Open your study → Settings → API Keys.
  2. Click Create API Key and give it the interview:read permission.
  3. Copy the key once and store it in n8n's credentials manager or an environment variable.
  4. Note the study id. API keys are study scoped, so one key reads one study.

See Webhook Setup for the completion patterns that exist today and the payload format.


Step 3: Keep Only Newly Completed Interviews

Add a Function node after the HTTP Request node and paste:

// Runs once per polled interview. Keep only the interviews that are
// finished, analysed, and not already routed.
const interview = $input.first().json;

if (interview.status !== 'completed' || !interview.analysis) {
  return []; // not ready yet, the next run picks it up
}

const store = $getWorkflowStaticData('global');
store.processed = store.processed || {};

if (store.processed[interview.interview_id]) {
  return []; // already routed, do not write it twice
}
store.processed[interview.interview_id] = true;

return interview;

Store the Koji API key in n8n's environment variables (or in the credentials manager for n8n Cloud). Never paste it directly into a node, because it ends up in the workflow export.

This step is essential. analysis is null until the background analysis job has finished, so gating on completed plus analysis means a pass only ever picks up fully processed interviews. The dedupe key stops the same interview being written to your downstream systems twice.


Step 4: Route by Quality, Segment, or Sentiment

Add a Switch node after the Function node. Configure rules that branch on the payload:

  • Branch 1: {{ $json.data.quality_score >= 4 }} → high-signal interviews
  • Branch 2: {{ $json.data.quality_score < 3 }} → low-signal interviews that need researcher review
  • Branch 3: {{ $json.data.metadata.segment === 'enterprise' }} → Enterprise segment alerts

Each branch flows to a different destination node.


Step 5: Fan Out to Destinations

Notion: Append a Page With Transcript

Add a Notion node:

  • Operation: Create Page
  • Database: select your research repository database
  • Properties: map Name → {{ $json.data.respondent.display_name }}, Quality → {{ $json.data.quality_score }}, Segment → {{ $json.data.metadata.segment }}
  • Body: add a Heading with the interview title, then a Toggle containing the AI-generated summary, and a Code Block containing the structured answers JSON

To pull the full transcript and the structured analysis (themes, sentiment, all answers), add an HTTP Request node before the Notion node:

GET https://www.koji.so/api/v1/interviews/{{ $json.data.interview_id }}
Authorization: Bearer YOUR_KOJI_API_KEY

Use the response to populate richer Notion fields. See User Research API for the full endpoint.

Linear: Create a Ticket for Low-Quality Interviews

In the low-quality branch, add a Linear node:

  • Operation: Create Issue
  • Team: your research-ops team
  • Title: Low-signal interview — review needed (quality {{ $json.data.quality_score }})
  • Description: include the transcript URL https://www.koji.so/projects/{{ $json.data.project_id }}/interviews/{{ $json.data.interview_id }}
  • Labels: research-qa, the segment, the study slug

This is how research-ops teams catch interview design issues before they propagate — if quality scores trend low for one question, that question needs revision.

Slack: Alert on Enterprise Feedback

In the Enterprise-segment branch, add a Slack node:

  • Operation: Post Message
  • Channel: #cs-enterprise-feedback
  • Text: New Enterprise interview from {{ $json.data.respondent.display_name }} ({{ $json.data.metadata.company }}). Quality {{ $json.data.quality_score }}. <https://www.koji.so/projects/{{ $json.data.project_id }}/interviews/{{ $json.data.interview_id }}|Open transcript>

CS leads love this pattern. Enterprise feedback gets human eyes within minutes of the interview ending.


Step 6: Test the Pipeline End-to-End

Run a preview interview in your study so there is a completed interview to read, then click Execute Workflow in n8n.

Watch n8n's executions list. You should see:

  1. Schedule Trigger fired and the HTTP Request node fetched the interview.
  2. Function node let it through: completed, analysed, and not seen before.
  3. Switch node routed to the correct branch.
  4. Destination nodes executed without error.

Then run a real interview through your published study and confirm a real participant's data lands in Notion / Linear / Slack. The end-to-end latency from interview-end to Notion-page is typically one to two minutes, set by Koji's analysis pipeline plus your poll interval.


Patterns That Scale

Idempotency

Poll passes overlap, and workflows get re-run by hand (see Webhook Setup). Make destination steps idempotent: use the interview_id as the Notion page ID lookup key, Linear external ID, etc. n8n's Get Many + If exists pattern works well.

Backpressure

If you run a high-volume study (1000+ interviews/day), put a Queue node (Redis or RabbitMQ) between the Function node and your destinations. n8n will then drain the queue at a controlled rate that respects downstream API limits.

Enrichment

Add an HTTP Request node to call your own internal services with the respondent's email or external ID to enrich the payload with internal data (plan tier, ARR, account manager). This lets downstream destinations include business context the participant did not provide directly.

Reverse Trigger

The pattern also works in the other direction. Use n8n to trigger Koji studies — a Linear ticket marked "needs customer validation" can call POST /api/v1/interviews/start to open an interview for a chosen customer, send them the link with your own email tool, and feed the result back into the original ticket as a comment.


n8n vs. Other Automation Platforms

  • vs. Zapier: Zapier has the largest pre-built app catalog and is the fastest path for non-technical teams. n8n is the right pick when data residency matters, when costs at high volume become a concern (Zapier bills per task), or when you want to self-host.
  • vs. Make.com: Similar trade-off — Make has visual scenarios but is cloud-only. n8n adds self-hosting and a more flexible node-based runtime with full JavaScript Function nodes.
  • vs. Custom code: A custom webhook handler is more flexible than any visual tool but takes longer to build and maintain. n8n hits the sweet spot for most teams.

For Notion-specific workflows, see Sync Koji to Notion. For Zapier specifically, see Zapier Research Automation.


Security Checklist

  • Keep the Koji API key server side. A polling workflow needs only the interview:read permission. See the Function node code in Step 3.
  • Use environment variables or the credentials manager for the Koji API key. Never inline it.
  • Restrict any n8n Webhook node you add for forwarded embed events. Use a long, random string in the path so it cannot be guessed and replayed.
  • Run n8n over HTTPS. The Koji API is HTTPS only and your key travels in the Authorization header.
  • Rotate the Koji API key periodically from Settings → API Keys. Revoke any key whose origin is no longer trusted.

Related Resources

Related Articles

API Authentication

How Koji Headless API authentication works: pk_live_ API keys, permissions, session tokens, and origin allowlists.

Exporting Research Data from Koji: CSV, JSON, and Transcript Access

A complete guide to every way you can get your interview data out of Koji — from one-click CSV downloads to automated API pipelines.

Google Sheets + Koji: Launch AI Interviews from a Spreadsheet and Auto-Log Every Insight Back

Turn a Google Sheet of contacts into a batch of Koji AI interviews, and auto-append every completed interview's themes, sentiment, quality score, and transcript link back to a live results tab — no data stack required.

Connect Koji to Make (Make.com): Build No-Code Customer Research Automations

Use Make (formerly Integromat) scenarios to trigger Koji AI interviews from any app and route themes, sentiment, and transcripts to Slack, Notion, your CRM, or a spreadsheet, no code, using HTTP and Schedule modules.

Sync Koji Research Insights to Notion: Build a Self-Updating Research Repository

Connect Koji to Notion via Zapier (or the API) so every completed AI interview becomes a fresh Notion page — with transcript, structured answers, themes, quality score, and AI summary attached. Build a research repository that updates itself.

Research Automation: How to Build Real-Time Research Pipelines with Webhooks

Build automated research pipelines on the Koji API today: event-triggered interviews, completion detection, and insight routing, no native webhooks required.

Segment + Koji: Trigger AI Interviews from CDP Audiences and Sync Insights Back as Traits

Use Segment Audiences and events to trigger Koji AI-moderated interviews, then pipe themes, sentiment, and quality scores back into Segment as track events and user traits that fan out to every downstream tool.

Structured Questions in AI Interviews

Mix quantitative data collection — scales, ratings, multiple choice, ranking — with AI-powered conversational follow-up in a single interview.

User Research API: Embed AI Interviews into Any Product or Workflow

How to use Koji's User Research API to run AI-moderated interviews from your own backend. Covers REST endpoints, the embed widget, how to get completion signals without webhooks, authentication, rate limits, and headless interview patterns.

Webhook Setup

Koji has no native outbound webhooks yet. Three working alternatives: polling the read endpoint, embed completion events, and automation platforms.

Connect Koji to Zapier: Automate Customer Research Workflows in Minutes

Route every completed AI customer interview from Koji into 6,000+ Zapier apps — including Notion, Linear, Salesforce, Airtable, and Gmail. A step-by-step integration guide.

Zendesk + Koji: Trigger AI Interviews from Support Tickets and Sync Insights Back to Every Conversation

Use Zendesk triggers and webhooks to launch Koji AI-moderated interviews from solved tickets, low CSAT, or specific tags, then have a small scheduled worker poll Koji and post themes, sentiment, and a transcript link back onto the ticket automatically.