Skip to content
manyeyaPublic

About

An AI-powered workflow automation platform that helps you build, manage, and automate complex workflows effortlessly.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

225 Commits

Folders and files

Repository files navigation

Orchka

A powerful, developer-first workflow automation platform. Design, execute, and monitor complex workflows through a high-performance visual interface. Built for performance, observability, and AI-native automation.

Documentation • Getting Started Guide • Node Reference

Features

Visual Workflow Editor

  • Intuitive Canvas: Drag-and-drop interface powered by React Flow for building workflows
  • Step Connections: Clean, right-angled connections for easy readability
  • Node Palette: Organized nodes with search functionality
  • Organization Tools: Group nodes with automatic child movement and add annotations (sticky notes)
  • Advanced Interaction: Resizable nodes and improved canvas performance

AI Integration

  • AI Agent: Tool-calling agent (HTTP request, calculator, and a sandboxed code tool)
  • AI Generate: Text generation for content creation and transformation
  • AI Extract: Structured extraction against a JSON Schema you define
  • AI Classify: Categorize content with structured output (sentiment, intent, priority)
  • Multiple Providers: OpenAI, Anthropic and Google AI
  • Credential-only: Provider keys come from the encrypted, org-scoped credential store — never from environment variables
  • Sandboxed code tool: model-generated JavaScript runs in QuickJS/WebAssembly with no fetch, process or require, a 1 MB heap and a 1 s deadline

Expression Engine

  • JSONata Support: Transform data dynamically between nodes
  • Data Mapping: Map and transform outputs to inputs seamlessly
  • Conditional Logic: Complex expressions for branching and filtering

Real-time Execution & Monitoring

  • Enhanced Execution View: Detailed execution history with a visual trace timeline
  • Trace Timeline: D3-powered visualization of step durations and execution flow
  • Payload Viewer: Deep inspection of input/output data with a premium JSON viewer
  • Live Updates: Watch workflows execute with real-time status updates
  • Background Processing: Reliable execution with BullMQ and Redis for job queuing

Reliability & Durability

See the Execution Reliability guide and the engine README for the full details.

  • Smart Retries: Per-node retry classification — idempotent nodes (AI, HTTP GET, control) retry with exponential backoff; side-effecting nodes (social posts, HTTP POST) run once to avoid duplicate side effects
  • Dead-Letter Queue: Terminally-failed jobs are parked with their full payload + error for inspection and deliberate re-queue, never silently dropped
  • Crash-Safe Redis: Bundled Redis runs with append-only persistence (AOF) so in-flight runs survive a restart
  • Checkpointing: Step history is flushed to Postgres at periodic checkpoints (not just on completion) and retained without truncation for long runs
  • Parallel Branch Execution (opt-in): Run independent branches concurrently via shared Redis execution state with correct fan-in at Merge nodes (ORCHKA_PARALLEL_BRANCHES=1)

Node Types

  • Triggers: Manual Trigger, Cron Trigger (with timezone)
  • Actions: HTTP Request
  • Social: X, LinkedIn, Facebook Page, Instagram, Threads, Discord, Reddit, Bluesky, Mastodon, Pinterest
  • AI: AI Agent, AI Generate, AI Extract, AI Classify, AI Agent (experimental)
  • Control: Condition (If), Switch, Loop, Wait, Merge
  • Visual: Group, Annotation (no execution)

Credential Management

  • Secure Storage: AES-256-GCM encryption at rest; no endpoint returns a secret in plaintext
  • 19 Types: API Key, Basic Auth, Bearer Token, OAuth2, three AI providers, and ten social platforms
  • Org-scoped: teammates share credentials within an organization; workflows can't reach another org's
  • Audit Trail: every create, update, delete and execution-time resolution is logged
  • Credential Testing: Validate credentials before use in workflows

Security & Operations

  • Organization Isolation: every workflow, credential and execution is scoped to an org
  • Authentication: email/password plus GitHub and Google, with password reset and optional email verification
  • Rate Limiting: Redis-backed, so limits hold across replicas
  • Outbound URL Guard: HTTP nodes and agent tools cannot reach loopback, link-local, private ranges or .internal hosts unless explicitly allowed
  • Retention: a daily sweep expires step detail (30d) and executions (90d); daily rollups and un-triaged dead letters are never swept
  • Structured Logging: the worker emits JSON with a stable executionId on every line of a run
  • Graceful Shutdown: SIGTERM drains in-flight jobs before closing connections
  • Deployment: Dockerfiles for both processes, plus a Render blueprint and a DigitalOcean app spec

Tech Stack

  • Frontend: Next.js 15 (Turbopack), React 19, TypeScript
  • Workflow Canvas: React Flow (@xyflow/react) 12
  • Observability: D3.js (Trace Timelines), @uiw/react-json-view (Payload Inspection)
  • Styling: Tailwind CSS 4, shadcn/ui, Framer Motion, GSAP
  • Backend: Next.js API routes, tRPC 11
  • Database: PostgreSQL with Prisma ORM 6
  • Authentication: Better Auth (email/password, GitHub, Google)
  • AI: AI SDK, LangChain (OpenAI, Anthropic, Google Gemini, Groq)
  • Job Processing: BullMQ with Redis
  • Expression Engine: JSONata
  • State Management: Jotai, TanStack Query 5
  • Forms: React Hook Form, Zod

Getting Started

Prerequisites

  • Bun runtime
  • PostgreSQL database

Installation

  1. Clone the repository:
git clone https://github.com/manyeya/flowbase.git
cd flowbase
  1. Install dependencies:
bun install
  1. Set up environment variables:
cp .env.example apps/web/.env.local

Configure the following environment variables:

  • DATABASE_URL: PostgreSQL connection string
  • BETTER_AUTH_SECRET: Random secret for authentication
  • BETTER_AUTH_URL: Your app URL
  • CREDENTIAL_ENCRYPTION_KEY: 64-character hex key for credential encryption (generate with openssl rand -hex 32)
  • REDIS_URL: Redis connection URL (for BullMQ job processing)
  • ORCHKA_PARALLEL_BRANCHES: Set to 1 to run independent branches concurrently (optional, default off — see Execution Reliability)

AI provider keys are not environment variables. Add them under Credentials in the app, where they are encrypted at rest and scoped to an organization; a process-wide key would be shared by every organization on the deployment.

  1. Start Redis with append-only persistence (recommended — survives restarts):
docker compose up -d redis
  1. Set up the database:
bun run prisma migrate dev
bun run prisma generate
  1. Start the development server (app + BullMQ worker):
bun run dev:all

The application will be available at http://localhost:3000.

Development Commands

# Primary development
bun run dev              # Start Next.js dev server with Turbopack
bun run dev:all          # Start web + worker together via mprocs
bun run build            # Build every workspace
bun run build:web        # Build the Next.js app only
bun run start            # Start the production server
bun run lint             # Run ESLint
bun run typecheck        # tsc --noEmit across every workspace
bun run test             # Run the vitest suite

# Database (Prisma)
bun run prisma:generate  # Generate the Prisma client (required after a fresh clone)
bun run prisma:migrate   # Create and run migrations
bun run prisma:studio    # Open Prisma Studio (DB GUI)

# Workflow engine worker
bun run worker           # Start the BullMQ worker

# Documentation site (separate Nextra site in apps/docs-site)
bun run docs:dev
bun run docs:build

Running in Docker

Two images, one per process. Build from the repo root:

docker build -f Dockerfile.web    -t orchka-web .
docker build -f Dockerfile.worker -t orchka-worker .

Or run the whole stack with compose:

docker compose --profile app up -d

Both need DATABASE_URL, REDIS_URL and CREDENTIAL_ENCRYPTION_KEY. The encryption key must be byte-identical between the two — a mismatch doesn't error, it just makes credentials undecryptable.

Migrations are run by neither image. Apply them once, before rolling out:

docker compose run --rm worker bunx --bun prisma migrate deploy --schema packages/db/prisma/schema.prisma

Two things to keep right when deploying elsewhere:

  • Give the worker a long stop timeout (stop_grace_period: 180s, or docker stop -t 180). It drains in-flight jobs on SIGTERM, but concurrency is 5 + 10 and AI/HTTP nodes run for minutes. Many platforms default the grace period to zero.
  • Only the web service binds a port. Don't give the worker an HTTP healthcheck; /api/health is web-only and is liveness, not readiness — it deliberately doesn't probe Postgres or Redis, so a transient blip during a rollout can't turn into a rollback loop.

Project Structure

├── app/                    # Next.js app directory
│   ├── (auth)/            # Authentication pages (login, register)
│   ├── (dashboard)/       # Dashboard and editor pages
│   ├── (editor)/          # Workflow editor interface
│   └── api/               # API routes
├── components/            # Reusable UI components
│   ├── react-flow/       # React Flow node components
│   └── ui/               # shadcn/ui components
├── features/              # Feature-specific code
│   ├── auth/             # Authentication forms and logic
│   ├── credentials/      # Credential management (CRUD, encryption)
│   ├── editor/           # Workflow editor components
│   ├── executions/       # Execution history and monitoring
│   ├── landing-page/     # Landing page features
│   ├── nodes/            # Workflow node implementations
│   └── workflows/        # Workflow management
├── hooks/                # Custom React hooks
├── lib/                  # Utility libraries
├── bullmq/               # BullMQ job processing and workflow orchestration
├── trpc/                 # tRPC routers and configuration
├── prisma/               # Database schema and migrations
└── docs-site/            # Documentation site

API Documentation

The application uses tRPC for type-safe API communication. Key procedures include:

Workflows

  • workflows.getWorkflows: List workflows with pagination and search
  • workflows.getOneWorkflow: Get a single workflow with nodes and connections
  • workflows.createWorkflow: Create a new workflow with a default trigger node
  • workflows.updateWorkflow: Update workflow nodes and connections
  • workflows.updateWorkflowName: Update workflow name
  • workflows.removeWorkflow: Delete a workflow
  • workflows.executeWorkflow: Trigger workflow execution

Credentials

  • credentials.list: List credentials with optional type filter
  • credentials.getById: Get credential metadata by ID
  • credentials.create: Create a new encrypted credential
  • credentials.update: Update credential name or data
  • credentials.delete: Delete a credential and clear node references
  • credentials.test: Test credential validity with the provider

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License.

Documentation

For detailed documentation, visit the docs site or run bun run docs:dev locally.

About

An AI-powered workflow automation platform that helps you build, manage, and automate complex workflows effortlessly.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages