AutoMata landing page
Live

AutoMata

AI workflow automation SaaS — no Zapier, no n8n, built from scratch.

Domain

automata-gk7u.onrender.com

Stack

Next.jsTypeScriptPostgreSQLPrismaOAuth 2.0React FlowClerkStripe

AutoMata

Full-Stack AI Workflow Automation Platform

MIT License Next.js TypeScript PostgreSQL Stripe Clerk

Visually build, orchestrate, and execute multi-step automation pipelines across external services — without Zapier, Make, or n8n.

Features · Architecture · Setup · Roadmap


What is AutoMata?

AutoMata is a workflow orchestration platform built entirely from scratch — no Zapier, no Make, no n8n under the hood. Every OAuth flow, every graph traversal, every credit deduction was engineered from first principles using official APIs.

Users connect services like Google Drive, Gmail, Slack, Discord, Notion, and Google Calendar, then compose those connections into automated pipelines using a drag-and-drop visual builder. Workflows execute through an event-driven runtime that traverses the graph in dependency order, propagates outputs between nodes, and logs every operation for forensic review.

The result is a multi-tenant SaaS platform where every user's integrations, credentials, workflows, and billing state are fully isolated from each other.


Platform Architecture

AutoMata Architecture

The platform is composed of five independent layers, each with a single responsibility, connected through a central execution runtime.

LayerResponsibility
AuthenticationIdentity verification, session management, and route-level access control via Clerk
IntegrationOAuth 2.0 authorization flows, token persistence, refresh lifecycle, and scope validation
Workflow BuilderDrag-and-drop graph composition, edge dependency creation, and workflow serialization
Execution RuntimeTrigger handling, topological graph traversal, context propagation between nodes
Billing InfrastructureCredit validation, per-execution deduction, Stripe payment processing, tier enforcement

Core Features

Visual Workflow Builder

The heart of AutoMata is a React Flow-powered infinite canvas where users assemble workflows by connecting nodes with edges. Each node represents a discrete operation — sending an email, querying a file, calling an AI — and edges define the execution order and data dependencies between them.

Workflows are serialized as graph structures in PostgreSQL, so they persist across sessions, can be duplicated, and resume execution exactly where they left off after a failure.

AI Execution Nodes

AutoMata ships with Gemini-powered AI nodes that fit directly into the workflow graph. Users configure a prompt, inject upstream context variables (like a file's contents or a Slack message's text), and the node's output flows into whatever comes next in the pipeline. Multiple AI nodes can be chained, letting complex multi-step reasoning happen inside a single automated workflow.

Native OAuth 2.0

Every platform integration — Google, Slack, Discord, Notion — is implemented from scratch using each provider's official OAuth 2.0 spec, without wrapper libraries. Access and refresh tokens are encrypted at rest, scoped strictly to the authenticated user, and refreshed transparently when they expire. This means AutoMata never shares credentials between tenants and has complete control over the token lifecycle.

Event-Driven Execution Runtime

When a trigger fires (a new Google Drive file, a Slack message, a calendar event), the runtime loads the subscribed workflow's graph, sorts nodes into dependency order using a topological traversal, and executes each node sequentially — passing outputs downstream as it goes. Every run is logged with per-node status, duration, and credit consumption.

Usage-Based Billing

AutoMata charges credits per workflow execution. Users purchase credits through Stripe, and the runtime validates balance before each run — pausing the workflow and notifying the user if credits are insufficient. This model scales naturally: light users pay almost nothing, heavy users pay proportionally.


Supported Workflow Nodes

NodeTypeDescription
TriggerSourceInitiates workflow on an external event
AIProcessorGemini-powered intelligent processing with context injection
ConditionControlBranches execution based on evaluated logic
WaitControlDelays execution for a configured duration
GmailActionSends email via the authenticated Google account
SlackActionPosts messages to configured channels
DiscordActionDelivers messages via webhook
NotionActionCreates or updates pages and database entries
Google DriveActionUploads, reads, and manages files
Google CalendarActionCreates and manages calendar events

OAuth Integrations

AutoMata implements OAuth 2.0 natively for every supported platform. The flow is identical across providers:

User clicks "Connect" on a platform
        ↓
Redirect to provider's authorization screen
        ↓
User grants permission, provider returns auth code
        ↓
Backend exchanges code for access + refresh tokens
        ↓
Tokens encrypted and persisted, linked to user ID
        ↓
Execution runtime fetches per-user credentials at run time
        ↓
Expired tokens refreshed transparently
PlatformTrigger SupportAction SupportAuth Method
Google Drive✅ File events✅ Upload, readOAuth 2.0
Gmail✅ Inbox triggers✅ Send emailOAuth 2.0
Google Calendar✅ Event triggers✅ Create eventsOAuth 2.0
Slack✅ Message events✅ Post messagesOAuth 2.0
Discord—✅ Webhook messagesWebhook URL
Notion—✅ Pages, databasesOAuth 2.0

Workflow Execution Lifecycle

When a trigger fires, AutoMata's runtime takes over:

1. Trigger Detection — An external event arrives from a connected integration.

2. Workflow Resolution — The dispatcher looks up all workflows subscribed to that event type for that user.

3. Graph Loading — The workflow's nodes and edges are loaded from the database and reconstructed as an in-memory graph.

4. Dependency Traversal — Nodes are topologically sorted so that no node executes before its dependencies have resolved.

5. Node Execution — Each node runs in order: making API calls, invoking AI, evaluating conditions, or waiting. Failures are caught and logged without crashing the runtime.

6. Context Propagation — Each node's output is injected as input variables into every downstream node, making the full execution context available at every step.

7. Credit Deduction — After successful execution, the per-run cost is deducted from the user's credit balance.

8. Execution Logging — The full runtime record (node statuses, durations, outputs, credit delta) is persisted and visible in the dashboard.


Billing & Credit System

FeatureDetail
ModelUsage-based credits
Payment processorStripe
Credit tiersFree, Pro, Enterprise
Execution costDeducted per workflow run
Insufficient creditsWorkflow paused, user notified
DashboardReal-time credit balance and usage history
Webhook validationStripe webhook signature verified server-side

Tech Stack

Frontend

TechnologyVersionPurpose
Next.js14Full-stack React framework, App Router
TypeScript5Type-safe development
Tailwind CSS3Utility-first styling
shadcn/ui—Accessible component library
React Flow—Interactive graph-based workflow canvas

Backend

TechnologyPurpose
Next.js Route HandlersServerless API endpoints
Next.js Server ActionsServer-side mutations
Prisma ORMType-safe database client
NodemailerTransactional email delivery

Infrastructure & Services

ServicePurpose
ClerkAuthentication and session management
StripePayment processing and webhook handling
NeonServerless PostgreSQL hosting
RenderProduction deployment

External APIs

APIAuth MethodUsed For
Google Drive APIOAuth 2.0File triggers and actions
Gmail SMTPOAuth 2.0Email send actions
Google Calendar APIOAuth 2.0Calendar event triggers and actions
Slack APIOAuth 2.0Message triggers and posting
Discord WebhooksWebhookMessage delivery
Notion APIOAuth 2.0Page and database actions
Gemini APIAPI KeyAI processing nodes

Screenshots

Landing PageDashboard
LandingDashboard
ConnectionsWorkflow Management
ConnectionsWorkflows
Workflow BuilderExecution Logs
Workflow BuilderLogs
Workflow History
History

Local Development Setup

Prerequisites

  • Node.js 18+
  • PostgreSQL database (Neon free tier recommended)
  • Clerk account
  • Stripe account with a webhook configured
  • Google Cloud project with OAuth 2.0 credentials
  • Slack, Discord, and Notion developer apps

Installation

# Clone the repository
git clone https://github.com/AaryanBairagi/AutoMata.git
cd AutoMata

# Install dependencies
npm install

# Configure environment variables
cp .env.example .env
# Fill in all variables — see section below

# Run database migrations
npx prisma migrate deploy

# Start development server
npm run dev

Environment Variables

# Database
DATABASE_URL=
DIRECT_URL=

# App
NEXT_PUBLIC_APP_URL=

# Authentication (Clerk)
CLERK_SECRET_KEY=
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=

# Google OAuth (Drive, Gmail, Calendar)
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=

# Slack OAuth
SLACK_CLIENT_ID=
SLACK_CLIENT_SECRET=

# Discord
DISCORD_CLIENT_ID=
DISCORD_CLIENT_SECRET=

# Notion OAuth
NOTION_CLIENT_ID=
NOTION_API_SECRET=

# Billing (Stripe)
STRIPE_SECRET=
STRIPE_WEBHOOK_SECRET=

# Email (Nodemailer)
EMAIL_USER=
EMAIL_PASS=

# AI
GEMINI_API_KEY=

Deployment

Before going to production:

StepDetail
OAuth redirect URIsRegister all callback URLs with Google, Slack, Discord, and Notion developer consoles
Stripe webhooksConfigure payment_intent.succeeded and subscription events, copy signing secret
Environment variablesSet all secrets in your hosting provider's dashboard — never commit .env
Database migrationRun npx prisma migrate deploy before first launch
Clerk production instanceSwitch from development to production Clerk app and update publishable key

Recommended stack: Render (app) · Neon (database) · Clerk · Stripe


Future Roadmap

AutoMata's core execution engine is complete. The next phase focuses on reliability, collaboration, and extensibility.

Execution Infrastructure

  • Queue-backed distributed execution with Redis and BullMQ for reliability at scale
  • Execution replay — re-run any failed workflow from any node in the graph
  • Real-time streaming — live visualization of workflow execution as it happens

Developer Experience

  • Variable autocomplete — dynamic variable picker inside node configuration panels
  • Workflow templates — pre-built automation templates for common use cases
  • Webhook triggers — custom inbound webhook sources beyond supported platforms

Platform Growth

  • Team collaboration — shared workspaces, workflow co-editing, permission management
  • Marketplace — publish and install community-built workflow templates
  • Advanced analytics — execution trends, credit forecasting, per-node performance metrics

License

MIT — see LICENSE.


Built by Aaryan Bairagi — deep-diving into workflow orchestration internals, OAuth infrastructure, AI execution pipelines, and modern SaaS automation architecture.