A collection of Cloudflare Workers-based workflows for handling various AI and content processing tasks. This project leverages Cloudflare's durable objects and workflow capabilities to create reliable, scalable AI processing pipelines.
-
Orchestrator Workflow (
/orchestrator
)- Handles news fact-checking pipeline
- Extracts claims from articles
- Performs parallel source verification
- Conducts historical analysis
-
Parallel LLM Workflow (
/parallel-llm
)- Manages concurrent LLM operations
- Optimizes throughput for multiple AI requests
-
Question Routing Workflow (
/routing-questions
)- Routes questions to appropriate AI models
- Handles question classification and distribution
-
Translation Copy Workflow (
/translate-copy
)- Translates marketing content to target languages
- Maintains tone and style consistency
- Supports word count optimization
-
Evaluator Optimizer Workflow (
/evaluator-optimizer
)- Evaluates translation quality
- Optimizes content based on metrics
- Node.js installed
- Wrangler CLI installed (
npm install -g wrangler
) - Cloudflare account with Workers access
- Clone the repository:
git clone [repository-url]
cd effective-agents
- Install dependencies:
npm install
- Configure your environment:
cp wrangler.jsonc.example wrangler.jsonc
# Edit wrangler.jsonc with your settings
Deploy to Cloudflare Workers:
wrangler deploy
Use the provided script to trigger the translation workflow:
// trigger-workflow.js
const payload = {
marketingSubject: "Your marketing content",
targetLanguage: "Spanish",
targetWordCount: 100,
};
async function triggerWorkflow() {
try {
const response = await fetch(
'https://effective-agents.ai-662.workers.dev/translate-copy',
{
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(payload),
}
);
if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`);
}
const data = await response.json();
console.log('Workflow triggered successfully:', data);
} catch (error) {
console.error('Error triggering workflow:', error);
}
}
triggerWorkflow();
Run the script:
node trigger-workflow.js
Base URL: https://effective-agents.ai-662.workers.dev
/orchestrator
- News fact checking workflow/parallel-llm
- Parallel LLM calls workflow/routing-questions
- Question routing workflow/translate-copy
- Content translation workflow/evaluator-optimizer
- Translation evaluation workflow?instanceId=XXX&workflow=YYY
- Check status of a running workflow
The project uses a component-based architecture with these key features:
- Durable Objects: For maintaining state across requests
- Workflow System: For managing long-running processes
- Parallel Processing: For optimizing throughput
- Error Handling: Built-in retries and failure management
- Monitoring: Built-in observability with sampling rate of 1
├── src/
│ ├── workflow/
│ │ ├── orchestrator-workflow.ts
│ │ ├── parallel-llm-workflow.ts
│ │ ├── routing-questions-workflow.ts
│ │ ├── translate-copy-workflow.ts
│ │ └── evaluator-optimizer-workflow.ts
│ ├── services/
│ │ └── ai/
│ └── index.ts
├── wrangler.jsonc
└── package.json
The wrangler.jsonc
file contains all necessary configuration:
- Project name and entry points
- Workflow bindings
- Compatibility settings
- Observability configuration
- Fork the repository
- Create your feature branch
- Commit your changes
- Push to the branch
- Create a new Pull Request
[Add your license here]
For support, please [add support contact information]