n8n is a production-grade workflow automation and AI agent platform. In production, it runs as a Node.js Express server with a Vue 3 frontend, executing user-defined workflows composed of nodes (triggers, actions, LLM calls). Workflows can be triggered manually, via webhooks, schedules, or events, and the execution engine handles concurrency, retries, errors, and data passing between nodes. The platform supports AI agents through an SDK that manages LLM calls, tool execution, memory, conversation loops, and MCP (Model Context Protocol) integration, enabling autonomous multi-step agents. Architecturally, the monorepo is organized into backend (packages/cli, packages/core, @n8n/engine), frontend (packages/frontend/editor-ui), database layer (@n8n/db with TypeORM), AI/agent packages (@n8n/agents, @n8n/ai-utilities, @n8n/instance-ai), and a vast node/credential library (packages/nodes-base, @n8n/nodes-langchain). Dependency injection is handled by @n8n/di, controllers are decorated with @RestController, and database models use a forked TypeORM. The system supports multiple database backends (PostgreSQL, SQLite) and can scale with Redis and worker processes. Key data flows: Workflow definitions are persisted in the database with version history. Execution data (inputs, outputs, binary data) is stored for monitoring and replay. The AI agent runtime uses a persistent message store for conversation memory, supports checkpoint/restore for long-running agents, and integrates with external LLMs (OpenAI, Anthropic, etc.) via a unified model factory. The platform exposes REST APIs for CRUD operations on workflows, credentials, users, and executions, as well as WebSocket push for real-time UI updates. External dependencies include a database, optional Redis for scaling, and numerous third-party services via nodes and credentials.
FlowGram is a comprehensive, production-grade visual workflow development framework from ByteDance. The codebase implements two distinct editing paradigms — fixed-layout (automatic positioning with composite nodes like loops, branches) and free-layout (node-position-free with lines) — both built on a shared plugin architecture using inversify for dependency injection. The framework includes a form engine with reactive fields, validation, and effects; a variable engine with AST-based type inference and scoped lifecycle; and a runtime engine capable of executing workflows with executors for LLM, HTTP, code (QuickJS sandbox), and conditions. The repository contains over 40 packages managed via Rush monorepo, encompassing core libraries, plugins (history, minimap, auto-layout, group, snap, clipboard, export), UI material libraries (Semi UI, Ant Design), a CLI tool for scaffolding, multiple demo applications, and comprehensive documentation. The system is actively maintained with regular commits, CI workflows, and E2E tests. Notable technical decisions include a local fork of the use-gesture library for canvas interaction, heavy decorator-based IoC, and support for both React 17 and 18. While the architecture is well-structured and extensible, the codebase shows signs of duplication between fixed and free layouts, numerous demo-specific components, and some deprecated APIs that indicate ongoing refactoring.