An agentic workflow playground built with Trigger.dev, OpenAI, and Jina AI. This project demonstrates an LLM-powered workflow with chain-of-thought reasoning and web search/reading capabilities.
This repository contains a Trigger.dev workflow that:
- Uses OpenAI GPT-4.1-mini for natural language understanding and reasoning
- Leverages Jina AI for web search (
/s/jina.ai) and web reading (/r/jina.ai) - Implements a Chain-of-Thought + Reflexion prompting pattern for structured reasoning
- Employs OpenAI's tool calling (function calling) for integrated web search and reading
src/trigger/
example.ts # Main workflow task (company-finder)
procedures/
jina.ts # Jina AI search and reader integrations
data/
index.ts # Chain-of-Thought Reflexion prompt template
trigger.config.ts # Trigger.dev configuration
The main workflow (sendUserEmailWorkflow) accepts a query and:
- Initializes an LLM with a Chain-of-Thought + Reflexion system prompt
- Provides two tools:
web-search: Search the web via Jina AIweb-reader: Read web page content via Jina AI
- Loops until the model produces a
<<Final Response>>tag - Returns the complete conversation with reasoning
- Node.js 18+
- npm or pnpm
- OpenAI API key
- Jina AI API key
npm installCreate a .env file with:
OPENAI_API_KEY=sk-...
JINA_API_KEY=...Update trigger.config.ts with your Trigger.dev project ID:
export default defineConfig({
project: "your-project-id",
maxDuration: timeout.None,
});Deploy and run via Trigger.dev dashboard, or use the Trigger.dev CLI:
trigger dev- @trigger.dev/sdk - Workflow orchestration
- openai - OpenAI API client
- ai - AI SDK utilities
- @ai-sdk/openai - OpenAI provider for AI SDK
- zod - Schema validation
MIT