trigger-agents

Implements durable AI agent workflows on Trigger.dev using chat agents, sessions, and orchestration patterns.

Updated Sep 6, 2026
One-click install
npx skills add https://github.com/inventashif/helpful-code-sidekick --skill trigger-agents-inventashif
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: trigger-agents
Source: https://github.com/inventashif/helpful-code-sidekick/tree/main/scripts/hackerai/.agents/skills/trigger-agents
Command: npx skills add https://github.com/inventashif/helpful-code-sidekick --skill trigger-agents-inventashif

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @trigger.dev/sdk, @trigger.dev/react-hooks, ai, @ai-sdk/openai, @ai-sdk/anthropic, zod, and includes references (resource) components.

What problem does it solve? Building LLM-powered agents that survive crashes, redeploys, and reconnects requires durable execution infrastructure that most ad-hoc API routes lack. This Skill provides production patterns for Trigger.dev 4.5 so AI chat surfaces, parallel workers, and human approval gates run reliably without hand-rolled streaming protocols. ## Core Features & Use Cases - Durable Chat Agents: Build Vercel AI SDK chat surfaces with chat.agent, Sessions, versioned AI Prompts, and bundled Trigger Agent Skills that resume across run swaps. - Agent Orchestration Patterns: Apply prompt chaining, routing, parallelization, orchestrator-workers, and evaluator-optimizer loops using typed batch.triggerByTaskAndWait calls. - Human-in-the-Loop & Streaming: Pause tasks for human approval with waitpoint tokens and stream real-time progress or AI completions to React frontends. - Use Case: A team building a support chatbot can define a chat.agent with dashboard-overridable prompts, let the LLM call backend tasks as tools via ai.tool, and gate sensitive actions behind Slack approval waitpoints. ## Quick Start Ask the agent to scaffold a Trigger.dev chat.agent task with a versioned system prompt and a parallel fan-out worker for processing user requests.

Frequently Asked Questions about trigger-agents

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build a durable AI chat agent with Trigger.dev?

Define a chat.agent task that returns streamText from the Vercel AI SDK, spreading chat.toStreamTextOptions() to wire prompts, skills, and telemetry. On the frontend, pass useTriggerChatTransport to useChat for durable reconnect and resume behavior.

How to run LLM tasks in parallel with Trigger.dev?

Use batch.triggerByTaskAndWait with an array of task and payload pairs to fan out work, then destructure the typed runs array. Check each run's ok flag before reading output, and control concurrency via queue settings on child tasks.

What is the difference between chat.agent and Sessions in Trigger.dev?

chat.agent is purpose-built for Vercel AI SDK chat surfaces with one long-lived task per conversation. Sessions are the lower-level primitive for non-chat interactions that still need durable bidirectional streaming across run boundaries.

Can an LLM call Trigger.dev tasks as tools?

Yes, ai.tool converts a schemaTask into a Vercel AI SDK tool the model can call autonomously. The task must use schemaTask with a Zod or compatible schema; plain task definitions without schemas are not supported.

How do I add human approval to a Trigger.dev agent workflow?

Create a waitpoint token with wait.createToken, send its URL or ID to a human via Slack or email, then block on wait.forToken until the token is completed or times out. Increase the task's maxDuration to account for human response time.

Why does ai.tool fail with a regular Trigger.dev task?

ai.tool requires a schemaTask because it derives the tool's JSON schema from the declared Zod, ArkType, or compatible schema. Tasks defined with the plain task() helper have no schema to expose, so conversion fails.