How vj-e/automation-workflow works
What this project is (type + purpose)
This is a single Next.js 15 (App Router) application that contains:
• A visual workflow builder UI (React + React Flow) where users compose automation workflows by connecting nodes.
• A minimal backend execution endpoint (Next.js API Route) that likely accepts a workflow definition and runs it (trigger → AI processing → integrations).
• Multiple integration “node types” (Gmail trigger, Gemini AI processor, Discord webhook, Google Sheets append, SMTP email sender).
• No separate backend service and no database layer visible in the tree (state is likely in-memory/client-side, and workflows are probably executed on-demand via the API route).
So architecturally, treat it as a monolithic web app with a client-heavy editor and a server-side runner that calls external services.
File tree interpretation (what maps to architecture)
Key directories/files and what they imply:
Backend/API
• app/api/run/route.ts
• The primary server-side “workflow execution” entrypoint. This is your “Orchestrator/Runner API”.
UI components (editor + runtime UX)
• components/WorkflowEditor.tsx
• The React Flow canvas, nodes/edges, graph editing.
• components/NodeConfigPanel.tsx
• Configuration UI for the selected node (credentials/parameters).
• components/ExecutionConsole.tsx
• Displays execution logs / run status (likely streaming/polling in UI).
• components/Sidebar.tsx, components/TopBar.tsx
• Supporting layout/navigation.
Node types
• components/nodes/*Node.tsx
• Frontend node renderers and likely node-specific configuration schemas/UX:
• GmailTriggerNode.tsx (IMAP trigger)
• ProcessNode.tsx (Gemini AI step)
• DiscordNode.tsx (Discord webhook)
• GoogleSheetsNode.tsx (Sheets API + auth)
• EmailNode.tsx (SMTP via Nodemailer)
Misc
• check-models.js
• Likely a helper script to validate Gemini models / connectivity. Consider it “dev tooling”, not core runtime.
• next.config.ts, tsconfig.json, eslint.config.mjs, postcss.config.mjs
• Build/tooling, not runtime components.
README-derived architectural constraints / integrations
• Google Gemini API (AI summarization/transform)
• Gmail IMAP (trigger) via imap-simple
• SMTP (email sending) via nodemailer
• Discord Webhooks
• Google Sheets API (append rows) with Google Auth / Service Account (service-account.json)
environment/config:
• .env.local variables: GEMINI_API_KEY, EMAIL_USER, EMAIL_PASS
• Service account JSON in root: service-account.json
Clear labels for each component
Use explicit names tied to the repo:
• “WorkflowEditor.tsx (React Flow Canvas)”
• “NodeConfigPanel.tsx”
• “ExecutionConsole.tsx”
• “API: /app/api/run/route.ts (Workflow Runner)”
• “Node Executors: GmailTrigger / Process(Gemini) / Discord / Sheets / Email”
• “Workflow JSON (nodes, edges, configs)”
• “Execution logs / step outputs”
• “Email body / subject”
• “Prompt + context”
• “Webhook payload”
• “Append row request”
Checklist to ensure you didn’t miss essential elements
• [ ] Credentials placement is correct (server-side).
• [ ] Data passed between nodes is depicted as “context” flowing through the runner (Email → AI → Discord/Sheets/Email).
• [ ] Logging path is shown (Runner → ExecutionConsole).
• Whether execution is synchronous vs async
• Whether logs are streamed (SSE) vs returned at end
• Whether Gmail is polled per request vs long-running listener