Skip to content

vikyw89/trigger-dev-playground

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

trigger-dev-playground

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.

Overview

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

Project Structure

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

Workflow: company-finder

The main workflow (sendUserEmailWorkflow) accepts a query and:

  1. Initializes an LLM with a Chain-of-Thought + Reflexion system prompt
  2. Provides two tools:
    • web-search: Search the web via Jina AI
    • web-reader: Read web page content via Jina AI
  3. Loops until the model produces a <<Final Response>> tag
  4. Returns the complete conversation with reasoning

Setup

Prerequisites

  • Node.js 18+
  • npm or pnpm
  • OpenAI API key
  • Jina AI API key

Installation

npm install

Environment Variables

Create a .env file with:

OPENAI_API_KEY=sk-...
JINA_API_KEY=...

Configuration

Update trigger.config.ts with your Trigger.dev project ID:

export default defineConfig({
  project: "your-project-id",
  maxDuration: timeout.None,
});

Usage

Deploy and run via Trigger.dev dashboard, or use the Trigger.dev CLI:

trigger dev

Dependencies

License

MIT

Releases

No releases published

Packages

 
 
 

Contributors