#Choosing a workflow structure
Use the smallest structure that makes the important correctness, information, authority, and lifecycle boundaries visible. More Agents and more steps do not create assurance by themselves.
This guide helps choose a design; it is not a list of current Jig features. The direct-alpha guide defines what Jig supports today.
Code and Agent work share a Flow boundary. Choose their arrangement inside a method before adding orchestration around it. The request-triage example shows one caller using code, an Agent, or both without changing its calling model.
#Put each concern where it belongs
One method can occupy several rows. A test-driven repair loop, for example, combines deterministic tests, an Agent judgment or edit, and bounded repetition. The table places each concern where it can actually be implemented or enforced; it does not force the whole method into one category.
You do not need a dedicated Jig feature for every workflow method. Implement the method in the Flow, and rely on Jig only for the boundaries the host must enforce. A prompt can request a limit or permission, but only ordinary code or the host can enforce it.
#Add structure only for a stated reason
- If exact code can produce and check the result, use one reviewed Run.
- If one part needs interpretation or generation, give only that part to one Agent. Keep validation, stopping, and effects in code.
- If the work has distinct steps, start with a fixed sequence, branch, fan-out/join, or bounded loop. Add a graph when its topology needs to be inspected, tested, or reused.
- Add Agents only when roles need materially different evidence, skills, information access, or authority—not merely different personas.
- When a model chooses what happens next, construct the complete eligible set outside the model. Accept one allowed identifier or abstention, validate it, and invoke only the pre-authorized target.
- Put durable activation, shared resources, credentials, and consequential effects behind a real owner. Do not imitate them with conversational memory or an indefinitely running Flow.
These are design choices, not maturity levels. A useful application may need no Agent, no graph, or no host-managed service.
#Related method families
These established approaches can provide a useful starting point when a simple sequence is not enough:
- Refinement and verification: Self-Refine, Reflexion, CRITIC, and Chain-of-Verification.
- Decomposition and orchestration: prompt chaining, routing, parallelization, and orchestrator–workers, plus least-to-most prompting.
- Opposition and ensembles: multi-Agent debate, Mixture-of-Agents, and LLM-Blender.
- Candidate search: Tree of Thoughts, beam or evolutionary search, tournaments, and Best-of-N selection.
- Tool and environment feedback: ReAct, retrieval, tests, compilers, fuzzers, simulations, and benchmarks.
- Prompt and pipeline optimization: OPRO, DSPy, and TextGrad.
- Human governance: checkpoints, exception-based escalation, risk-tiered approval, and trustworthy Agent controls.
The orchestration-pattern catalogue explores reusable structures that may be especially useful in Jig applications.