Overview
This full-stack example shows how to build a visual, node-based workflow where each step in the pipeline is a Trigger.dev task and a human reviewer must approve an AI-generated summary before the audio version is created. Tech stack:- Next.js — web application framework
- ReactFlow — visual workflow UI
- Trigger.dev Realtime — subscribe to task runs and display live status
- Trigger.dev waitpoint tokens — pause the workflow until a human approves
- OpenAI API — generate article summaries
- ElevenLabs — convert text summaries to audio
GitHub repo
View the human-in-the-loop workflow repo
Fork this repo to use it as a starting point for your own human-in-the-loop project.
Demo video
How it works
The workflow consists of three Trigger.dev tasks wired together by an orchestrator, represented visually as ReactFlow nodes:summarizeArticle— calls the OpenAI API to produce a plain-text summary from a URLreviewSummary— pauses the workflow and waits for a human to approve or reject the summaryconvertTextToSpeech— sends the approved summary to ElevenLabs and uploads the resulting audio to S3articleWorkflow— the entrypoint that orchestrates all three tasks in sequence
Waitpoint token pattern
The human review step is powered by Trigger.dev waitpoint tokens. The token is created inside a Next.js server action when the workflow starts:app/actions.ts
reviewSummary task then suspends by waiting for that token:
trigger/reviewSummary.ts
app/actions.ts
reviewSummary task resumes and the orchestrator moves on to the
convertTextToSpeech step.
Real-time status with Realtime hooks
The ReactFlow UI shows the live status of each node by subscribing to task runs using theuseRealtimeRunsWithTag hook:
components/Flow.tsx
ActionNode receives the relevant run object and displays its current status (queued,
executing, completed, failed) in real time.
ReactFlow node types
| Node | Purpose |
|---|---|
InputNode | Starting node — accepts an article URL and triggers the workflow |
ActionNode | Displays the real-time status of a Trigger.dev task run |
ReviewNode | Shows the AI-generated summary and prompts for human approval |
Learn more
Waitpoint tokens
Learn how waitpoint tokens work and how to build human-in-the-loop flows
Trigger.dev Realtime
Subscribe to runs and stream live updates to your frontend
React hooks
Use React hooks to interact with the Trigger.dev API from your UI
Wait for token
Pause tasks and wait for human approval using waitpoint tokens