Dynamic Workflows

Author JavaScript orchestrator-backed factories and relate dynamic workflow APIs to Factory configuration.

Orchestrator Identity

The live FactoryOrchestrator definition is the authored orchestrator identity on one factory. Dynamic workflows use kind JAVASCRIPT with javascript configuration instead of Petri graph fields. When orchestrator is omitted, existing Petri factories load through compatibility defaulting to PETRI. Exhaustive Factory field inventories stay on the full schema and API reference pages.

FactoryOrchestrator

object

Authored orchestrator identity for one factory. When omitted, existing Petri factories load through compatibility defaulting to orchestrator.kind = PETRI.

  • additionalPropertiesfalse (closed)

Fields

JavaScript Orchestrator Configuration

The live FactoryOrchestratorJavaScriptConfig fragment carries workflow source identity, metadata, argsSchema, defaultPolicy, and optional inline source for JavaScript factories. Source-resolution knobs on the CLI and Model Context Protocol (MCP) surfaces resolve into this shared configuration shape rather than inventing a separate dynamic-workflow contract.

FactoryOrchestratorJavaScriptConfig

object

JavaScript-specific orchestrator configuration. JavaScript factories do not require Petri graph fields and instead declare workflow source identity, metadata, args schema, and default policy here.

  • additionalPropertiesfalse (closed)

Fields

  • agentsagentsOptionalobject

    Named child-agent roles and their operator worker preset defaults.

    • additionalProperties/$defs/FactoryOrchestratorJavaScriptAgent
  • argsSchemaargsSchemaOptionalobject

    JSON Schema object describing workflow invocation arguments.

    • additionalPropertiestrue (open)
  • defaultPolicydefaultPolicyOptionalobject

    Default JavaScript workflow policy object applied when no runtime override exists.

    • additionalPropertiestrue (open)
  • dialectdialectOptionalstring

    Optional JavaScript dialect label for the authored workflow source.

  • entrypointentrypointOptionalstring

    Optional exported entrypoint or phase name used to start the workflow.

  • inlineSourceinlineSourceOptionalFactoryOrchestratorJavaScriptInlineSource

    Inline workflow source when the factory carries source text directly.

  • metadatametadataOptionalStringMap

    Free-form JavaScript orchestrator metadata for authoring and diagnostics.

  • sourceHashsourceHashOptionalstring

    Optional content hash for the resolved workflow source.

  • sourceRefsourceRefOptionalstring

    Factory-relative or authored reference to the workflow source file.

Teaching embeds show the live orchestrator, JavaScript config, and invocation signature fragments that matter for dynamic workflows. They are not a substitute for the full schema or API inventories.

Invocation Signature

The live FactoryInvocationSignature fragment is the callable argument contract CLI, API, dashboard, and packaged-factory surfaces share when invoking one factory. Teaching embeds show the signature shape; exhaustive operation inventories and OpenAPI catalogs stay on the full schema and API reference pages.

FactoryInvocationSignature

object

Canonical callable argument contract for invoking one factory. When present, CLI, API, dashboard, docs, and packaged-factory surfaces should discover and normalize invocation inputs from this shared schema instead of transport- or factory-specific argument definitions.

  • additionalPropertiesfalse (closed)

Fields

API And Configuration Relationship

Dynamic workflows use the shared Factory Session API surface. Call the CLI workflow path to validate source and start or inspect a durable JavaScript Factory Session. Call Model Context Protocol (MCP) Factory Session tools from an MCP host. Read the same session through durable list, show, events, and preview style lookups. There is no separate dynamic-workflow resource type — every live run is still a Factory Session. Configuration covers two jobs: resolve JavaScript orchestrator source from a project root, and choose how an MCP host launches you mcp serve.Use the you workflow CLI path for JavaScript Factory Session work. Validate source before execution, start a durable session, then inspect status and result for that same Factory Session id. Full MCP tool catalogs and OpenAPI operation inventories stay on the API reference.
CommandPurpose
you workflow validateResolve and validate JavaScript workflow source without creating a Factory Session.
you workflow startStart one durable Factory Session asynchronously and return inspection links.
you workflow statusRead durable Factory Session lifecycle status and progress.
you workflow resultRead the durable Factory Session final or partial result.
Resolve workflow source from a project root before validation or start. Use you workflow validate with --dir for ordered lookup, --kind for the source kind, and optional --args-schema or --requested-policy JSON when the orchestrator needs those overrides.
KnobPurpose
--dir / project rootProject root used for ordered workflow source lookup. you workflow validate defaults --dir to factory.
--kind WORKFLOW_NAMEResolve a named workflow from the project root. Pair with --value for the workflow name.
--kind INLINE_WORKFLOWValidate inline orchestrator source text. Pair with --inline for the JavaScript or TypeScript source.
--args-schemaOptional orchestrator.javascript argsSchema JSON for validation and start contracts.
--requested-policyOptional requested policy override JSON applied through the shared validation and preview contract.
you mcp serve exposes the same you.factory_session.* tool catalog in both backing modes. Only the execution service behind the tools changes. Do not combine --runtime with --fixture-catalog.
ModeLaunch argsPurpose
Fixture-backed (default)mcp serveDeterministic durable session fixture catalog for install smoke, fixture-driven polling, and offline host validation.
Runtime-backedmcp serve --runtimeShared durable JavaScript runtime for live INLINE_WORKFLOW execution with real async start, status polling, and result reads.

How To Use

Start from the definition and key concepts to learn what a dynamic workflow is and which Factory Session nouns it uses. Open the schema sections when you need live orchestrator, JavaScript config, or invocation fragments beside the prose. Continue with the Cursor dynamic-workflows guide for a first MCP host loop, the factories configuration page for Petri factory.json topology, the CLI documentation for the broader command matrix, or harness support when you need MCP and harness coverage across agents.

Limits And Assumptions

This page is the web reference for JavaScript dynamic-workflow API and configuration relationship. It is not the Cursor first-loop guide, not the full Model Context Protocol (MCP) host catalog deep dive beyond dynamic-workflow needs, not a duplicated OpenAPI or operation inventory, and not the Petri factory.json topology overview owned by the factories configuration page. Sibling links aid discovery only. Exhaustive orchestrator, invocation, and session inventories live on the schema and API reference pages linked from the schema sections.

Tags