Create a Workflow
A Workflow package contains source definitions and a compiled ESM entry. This guide builds a small capture workflow: it saves the original intent as one Record, then completes. It needs no Agent to demonstrate the package and execution contracts.
This is an authoring walkthrough within the framework docs. Business-specific workflow manuals and full application examples are separate concerns.
Prepare the package
Create this layout in a new package directory:
Use this package.json:
The IntLoom versions above match this development tree. They require those releases to be available from your registry. Before publication, supply verified local packages or a local registry. Within the IntLoom monorepo, use workspace:* for workspace dependencies and the root Bun/Turbo commands.
For this standalone package, use tsconfig.build.json:
The Compiler overrides emission settings in a temporary build configuration. Keep include limited to production resource directories; including build.ts would emit the build script and incorrectly make the Compiler a runtime dependency. Add tools/**/*.ts when introducing Tools. Repository workspaces instead extend the shared root TypeScript configuration.
Define the route
workflow.yaml:
stages/capture.yaml:
Ending the Step ends its Stage. The Stage's outcome is then routed by workflow.yaml to the Workflow end.
Initialize business State
schemas/state.ts:
initializers/state.ts:
The initializer runs when the Stage is entered. It receives the current Run's context and returns Schema input. Compilation does not execute it.
Implement the Step
codes/capture.ts:
The Run ID is this package's chosen Record ID, not a framework requirement. The Step reads Stage State; the Runtime currently passes null as execution input. Return only the routing outcome.
Compile
build.ts:
After resolving the package dependencies:
Expected output includes dist/workflow.generated.js, declarations, compiled business modules, and source maps. The generated module exports blueprint, codes, and agentSpecs; this Code-only package has no Agent resources.
Continue with Build, test, and distribute to package and install it. For a model-free execution of this Code-only workflow, use the external MCP entry with useMcpAgent: true. The current CLI admission policy still requires llms.default for service execution.