Methods vs inline operations vs nested workflows¶
Three ways to compose computation inside a workflow definition. They differ in where the computation lives (and therefore in cost, testability, reuse). This page is a decision aid, not a tutorial.
Quick summary¶
| Choice | The computation lives in | Use when |
|---|---|---|
| Method operation | An external Docker image | Heavy computation, needs native libraries, called from many workflows |
| Inline operation | The workflow definition itself (value-model lambda) | Light arithmetic, lookups, conditionals — no method-engine roundtrip |
| Nested workflow operation | Another workflow type | Composition: building a higher-level workflow from existing ones |
Method operation¶
The computation runs outside the workflow process — packaged as a Docker image, invoked on each call. The platform sends inputs and configuration over a structured interface and gets outputs back.
Use a method when: - You need heavy compute, GPU, native libraries (CAD kernels, FEM solvers, mesh generators). - The operation is meaningful as a reusable unit — other workflows could call it. - You need to scale computation independently of workflow processing.
Cost: each call is a container start + result roundtrip. Not free.
Inline operation¶
The computation is expressed as a value-model lambda inside the workflow definition. The platform evaluates it directly — no network call, no container start, no method run.
Use inline when: - The work is value-model arithmetic, comparison, list manipulation, or selection. - The work is specific to this workflow and won't be reused. - You want sub-millisecond latency per call.
Cost: very low, but the surface is limited to what value models can express (no I/O, no native code).
Nested workflow operation¶
Invoke another workflow type as if it were a method. The nested workflow runs as a child workflow run; its outputs flow back to the calling operation.
Use nested workflows when: - You're building a higher-level workflow from existing workflow types. - You want the nested unit to be runnable on its own (which a method is too, but a workflow has its own configuration, validation, inputs/outputs). - You want different teams to own different parts of a multi-step computation.
Cost: a child workflow run with its own state machine, scheduling, and resource accounting. Heavier than a method call, but cleaner composition for multi-step pipelines.
A common pattern¶
A typical production workflow has a method-heavy interior (the solver, the mesher, the post-processor) wrapped by inline glue that selects parameters, derives intermediates from configuration, and validates outputs. Nested workflows live above that — composing several "production-ready" workflow types into a higher-level analysis.
If you're authoring a workflow type that mostly delegates to one method, the workflow type is mostly a re-shaping layer: its configuration schema mirrors the method's, its data interface mirrors the method's, the workflow definition is one method operation. The first-workflow-type tutorial shows that pattern.
Cross-references¶
- Methods.
- Workflow definition.
- Workflow types.
- Value models — the language for inline operations.