Free to start, no credit card. 15 runs a day, 3 of them with AI. Create free account
documentize.cloud

Architecture note

The engine already exists

Cloud runs on the DAG workflow orchestrator in Documentize.Plugin.Manager, not on a new execution stack.

The decision

Cloud is built on Plugins/Documentize.Plugin.Manager and its plugin tree, rather than on a new execution stack or on the Fn worker model.

The decisive argument is that the pipeline product we are describing needs a dependency graph, per-step file staging, crash resume and admission control — and all four already exist in the DAG orchestrator. Building them again on top of the single-operation worker model would mean reimplementing an engine that sits in the same repository.

What that gives us on day one

Rows marked planned are not wired in yet; everything else is running code.

MechanismWhat it doesWhere
YAML DAG templates45 shipped pipelines. Steps with dependsOn, canRunInParallel and priority. The same format carries user recipes, submitted inline.Workflow/Template/*.yaml
Workflow/YamlTemplateManager.cs
Format routingA table mapping (from, to) to a pipeline, published as GET /routes. This is the “pick a format” mechanic.Conversion/conversion-routing.json
Conversion/ConversionResolver.cs
Plugin manifests50+ plugins, each declaring kind, concurrency, timeout, CPU and memory cost, and pool support. A build step turns them into catalog.json.Plugins/*/plugin.json
Typed parametersA declared schema per plugin — the source for CLI flags, JSON binding, help text, recipe validation and the console's generated forms. Most plugins declare one; the catalogue flags the rest.Plugin.Shared/CliOptionAttribute.cs
Resource governorPod-level weighted admission across all concurrent invocations. Blocks for backpressure instead of dropping work.ResourceGovernor.cs
Pipeline entryA pipeline topic accepts a shipped template name or an inline plan. The plan is validated before anything runs. Transport is Kafka, or ConfigMap queues on Kubernetes when there is no broker.Queue/ITaskQueue.cs
Workflow/PipelineMessage.cs
Per-step optionsA step's with: keys (CLI option names) are translated through the catalogue and merged into that step's payload. Options are part of the step id, so a changed option never reuses an old checkpoint.Workflow/StepOptions.cs
Lazy plugin processesNothing is warm at boot. A plugin's worker starts on first call and stops after an idle TTL; PLUGIN_PREWARM lists any to start early.PluginInvokerPool.cs
Step leasing behind a flagWith DAG_STEP_LEASING=true, pipeline state lives in the bucket and every pod leases the ready steps it has room for. A pod killed mid-step loses only that step.Workflow/Leasing/
Four invocation modesHot pooled process, cold process, in-process and util — selected per plugin from its manifest.Invocation/PluginInvokerFactory.cs
Split, fan out, merge plannedThe plan builder for page-range splitting exists but the orchestrator does not use it yet. Fan-out over files is done by Cloud.Api, one pipeline per file.Workflow/WorkflowPlanBuilder.cs
Crash resumeA checkpoint written after each successful step, so a re-delivery skips completed work.Invocation/S3CheckpointService.cs
Live progressPlugins report percentage and message; a per-step monitor publishes to Redis (or the Kubernetes status fallback), and Cloud.Api relays it to the browser as server-sent events.Plugin.Shared/StatusReporter.cs
Workflow/ProgressMonitoringService.cs

How a step actually executes

Worth understanding, because two of the three planned changes follow from it.

The orchestrator topologically sorts the plan into batches and runs each batch in parallel. Before a step runs, its input directory is staged: a root step is seeded from the task's input directory, and a dependent step receives the output files of everything it depends on. After the last step, the output is promoted to the canonical task directory and the checkpoints are cleared.

Steps therefore chain through the file system, and one process owns a whole pipeline for its duration. That is simple and fast, and it is also why distributing a pipeline across pods is a real piece of work rather than a configuration change.

A consequence worth having — now built

Because a pipeline is keyed by task id and staged from that task's own directory, running a recipe over twelve files is simply twelve pipeline instances, each with its own checkpoints and progress. Cloud.Api's run advancer does exactly this; the orchestrator needed no change for it.

One caution about the templates

Two dialects — now separated

The template folder contains two YAML shapes. Templates using steps: with pluginName: are real — they deserialize into the workflow model and name plugins that exist in the registry.

Templates using streamingSteps: with an executablePath: pointing at binaries such as SentimentAnalyzer.exe are a design sketch: those executables are not in the repository. The four of them now live in Workflow/Design/, which is not shipped. The cloud DSL is built on the steps dialect.