Build
title: Getting Started
Get up and running with GoFlow in minutes.
Prerequisites
- Go 1.21 or later
- (Optional) Redis or DragonflyDB for persistence
Installation
This adds GoFlow as a dependency to your Go module. The package provides all core functionality including agents, workflows, queues, and tools.
Your First Agent
Create a simple AI agent that can use tools:
What this code does:
-
LLM Client - Creates a connection to OpenAI. This is the "brain" that powers the agent's reasoning.
-
Tool Registry - Sets up the tools the agent can use.
BuiltinTools()includes common utilities, and we add a calculator for math operations. -
Agent Creation - Combines the LLM and tools into an agent.
WithMaxIterations(10)prevents infinite loops by limiting reasoning steps. -
Running a Task - The agent receives the task, thinks about it, uses tools as needed, and returns the final answer.
Run as a Service
Start GoFlow as a standalone service:
This starts the API server with REST endpoints and WebSocket support for real-time events.
Then use the JavaScript SDK:
The SDK connects to your running server and provides a clean TypeScript interface. The agent().run() method sends the task and waits for the result.
Webhooks
Trigger jobs via webhooks from external services:
External services (GitHub, Stripe, etc.) can now POST to your webhook endpoints:
POST /webhooks/github→ Enqueues aprocess_github_eventjobPOST /webhooks/order→ Starts theorder-processworkflow
Next Steps
- Installation - Detailed setup guide
- Agents - Deep dive into agent capabilities
- Workflows - Build complex workflows
- Webhooks - Trigger jobs from external services
- Examples - See complete examples
