We kept adding branches to our creative workflows because users kept asking for things our branches didn’t cover.
At Solstice, generating an email can involve selecting evidence, writing copy, interpreting a reference, placing images, preserving required language, compiling the document, and checking the result in a browser. We built explicit LangGraph workflows for that process then added more to handle its variations.
Our older implementation is a record of those decisions. We have separate routes for different kinds of emails, banners, social posts, slides, video, and webpages. Within those routes, LangGraph divides the work into named steps connected through shared state.
We didn’t set out to do graph engineering. We had a product to ship and a series of decisions that needed to happen reliably.
Now we’re moving more of those creative decisions into agents that choose what to do next based on the task and the results of the previous actions. The migration is still underway. The new generation path currently covers email, banners, and social assets, while the older system supports a broader range of formats.
We’re not eliminating ordinary control flow. We’re reconsidering which decisions we make in advance.
The graphs earned their place
In a workflow graph, nodes perform individual steps and edges determine what happens next. Conditional edges select routes based on the current state, which carries information between steps.
One of our older email graphs groups claims, filters them, adds surrounding copy, checks the email for cohesion, and applies visual edits. The graph can route a visual consistency check back to the editor, or wait for user feedback before sending the email through another edit.
Another email workflow breaks production into a more detailed sequence: Plan the content, assign evidence to sections, write the main copy, add microcopy, allocate the final content, prepare references, and design the header.
From there, the default rendering branch generates MJML, compiles it into email HTML, and runs screenshot-based visual QA before moving through cohesion and compliance checks. We use MJML because email clients have their own rendering constraints. HTML that looks fine in a browser isn’t necessarily ready to send.
These graphs already used models, tools, and feedback loops. Separating the process into stages made it easier to inspect intermediate output and diagnose failures.
If the references were wrong, we could examine the references step. If the rendered email looked wrong, we had a dedicated visual pass. That structure worked well as long as requests followed a familiar pattern.
The images below show an explicit workflow and a model-directed loop:
An explicit workflow defines the stages and routes in application code, including feedback loops. A model-directed loop gives the agent capabilities and boundaries, then lets it select the next action.
Our older workflows were already agentic; the difference is how much of the creative sequence gets decided at runtime.
Then the request stopped fitting the route
Consider an illustrative request:
“Use this layout, keep the approved copy, replace the hero image, and make the mobile version less cramped.”
It’s a reasonable request from a person working on an email. But it crosses several boundaries in our workflow.
Matching the layout may require inspecting a reference. Preserving approved copy restricts what the writing step can change. Replacing the hero image might alter the visual balance of the page. Fixing the mobile layout may require another spacing pass, even after the desktop version looks finished.
We can encode every one of those actions in a graph. We can also add conditional routes and loops to handle different combinations.
The cost came from having to decide in advance how each new route would interact with every other supported request.
If the layout changes after we’ve inspected the reference, which checks need to run again? If the user only wants to replace an image, how much of the content process should restart?
Every new route creates questions about the state it receives, the work it repeats, the checks it might skip, and the edits it invalidates. The flowchart shows the routes, but not all the maintenance required to keep them correct.
Over time, our orchestration code accumulated content-specific branches, reference-specific paths, alternative renderers, and multiple generations of pipelines alongside one another. More and more product behavior ended up embedded in routing logic.
When users changed their requirements, we often had to solve another orchestration problem before we could handle the request itself.
Choosing the next action at runtime
In the newer architecture, we give the model a task, a working environment, and a defined set of tools. It can inspect the available material, make a change, observe the result, and decide what to do next.
Say the agent needs to update a visual asset to match a reference. It might inspect the reference, read the current document, change the layout, and render the result. If the render shows a heading wrapping badly, it can change the heading’s container and render again.
Another request might need only a small copy edit and a single render. We want the sequence to depend on what the document actually needs, rather than on the path we anticipated when we wrote the graph.
Anthropic makes a similar distinction in “Building effective agents”: In a workflow, application code directs the sequence of operations; in an agent, the model dynamically directs its own process and tool use.
Our old architecture already combined both patterns. What’s changing is how much responsibility we’re giving the model for choosing the next step in the creative task.
That doesn’t mean the model controls the entire operation. The runtime still owns the mechanics of each turn, including event delivery, interruptions, and incomplete work. The backend manages the operation lifecycle and persistence. We don’t need the model figuring out how to save a draft safely every time it adjusts a heading.
We also keep generation and editing separate. Creating a document from a brief and modifying an existing document have different starting conditions, constraints, and product expectations. They can share infrastructure without being treated as the same operation.
A result becomes the next decision’s input
- 01InspectRead the artifact and relevant context
- 02ActChoose an available tool and make a change
- 03ObserveUse the result to decide what happens next
Example: a heading wraps badly after an image change. Inspect the rendered result → adjust the container → render again. A different request may require a different sequence.
An illustrative creative loop: The agent inspects the artifact and its context, chooses a tool, and uses the result to decide what comes next. The runtime continues to manage persistence, interruption, and the operation lifecycle.
Composing agents from capabilities
We’ve organized the new agent application around capabilities. Each capability provides what the agent needs for a particular kind of behavior: relevant workspace files, tools, instructions, and, where appropriate, verifiers.
Instead of building another end-to-end pipeline for each content type, we compose an agent from the capabilities its task requires.
Our email generation agent, for example, combines email authoring with image inspection, claims context, domain rules, and a brand guide. We include approved design examples when they’re available.
An editing agent can include reference-layout behavior when the request contains a visual reference, or stricter fidelity behavior when the document needs to be preserved closely.
The capability set is selected from the request package at initialization. The model then works with the tools and context provided for that operation.
That’s an important qualification to calling the agent “general purpose.” It can reason through different problems and choose how to approach them, but we don’t give every session every available tool.
We also validate each composition before execution. It must contain one content capability, include all required capabilities, and avoid conflicting registrations. Two capabilities can’t silently register the same tool name or claim ownership of the same workspace output. Invalid combinations fail during setup.
This gives us smaller contracts we can inspect and test. To introduce reference fidelity, for example, we can define the necessary context, tools, and checks, then compose that capability into the operations that need it. We don’t have to add another content-specific exception throughout the runtime.
We’ve also separated the agent application from the adapter connecting it to a particular agent runtime. The adapter translates tool and session contracts, while the application retains responsibility for the behavior we’re building at Solstice.
Preparing the agent’s tools and context
“Let the agent do whatever it wants” is an understandable reaction to an over-specified workflow. It’s a poor way to design the system that runs it.
We want the model to choose how to approach a task. We still decide which content types we support, which capabilities are available, which files belong to the operation, and how results make their way back into the product.
The new generation dispatcher rejects unsupported content types. We seal the application’s tool roster for each session, and individual modes can narrow it further.
Preparing the context is part of this work. The backend sends a persisted package for the operation. The agent’s workspace exposes the relevant parts as files it can inspect, with each output assigned to the component responsible for producing it.
For ordinary email generation, we deliberately narrow the package before deriving the agent’s context. We preserve the original creative request and the resolved audience, but remove the detailed blueprint and raw reference attachments from that view. Requests that explicitly depend on references use their own capability compositions.
Why remove information we already have?
Because the ordinary email agent should be designing from the user’s brief and relevant brand material, not treating an upstream implementation plan as if it were the user’s creative instruction.
A reference-led request is different. There, the agent needs capabilities and context that help it reproduce or interpret the supplied reference. We can support both behaviors without giving every agent the same information.
A larger context window gives us room for more information, but it doesn’t tell the agent which instructions represent user intent. Including every intermediate plan would make it harder to separate the user’s request from assumptions introduced earlier in the pipeline. That’s a distinction we still have to enforce in application code.
The application defines supported tasks, available capabilities, and the operation lifecycle. The agent decides what to inspect, change, and revisit within those boundaries.
What counts as a finished artifact?
When the model says it’s finished, we know its turn has ended. We don’t know whether the resulting artifact is correct, usable, or ready for review. We need to check the artifact itself.
Our capability system can attach verifiers to the agent’s output. The evaluator runs applicable measurement checks first, followed by judgment checks. That order lets us feed concrete findings into the more interpretive parts of evaluation.
A verifier can also request follow-up work within defined limits, including another review after initial measurements come back clean.
Those limits are deliberate. An unrestricted repair loop could keep spending time on a document without ever producing an acceptable result. Our runtime enforces step budgets and handles interruptions. A verifier failure is recorded as a failure. If a check throws an exception, we don’t treat that exception as evidence that the artifact passed.
Completion policies also vary by operation. Some capability compositions require verified generation and reject incomplete results. Our ordinary email generation composition currently allows a draft to survive with an explicit warning when the step budget or render verification leaves work unresolved.
A compiler can tell us whether an artifact can be built. A render check can expose layout problems. Neither can tell us whether the design makes sense for the intended audience.
That still requires human review and preference evaluation. Technical validity is necessary, but it doesn’t settle every creative decision.
The orchestration we’re keeping
We’re keeping explicit orchestration where the order of operations is known and mistakes are expensive.
Acquiring an execution environment, identifying the active operation, delivering events, saving a version, and cleaning up after a turn are ordinary software responsibilities. We want those processes to be predictable.
We’re giving agents more discretion where the necessary work depends on what they discover: interpreting a reference, finding relevant evidence, revising a composition, or deciding which part of a draft needs another pass.
Screenshot feedback, evidence handling, and user-directed revision still solve real problems. As we migrate capabilities, we need to preserve that behavior and verify that the new approach handles the cases those steps were built to address.
An agent can choose the wrong tool, repeat work unnecessarily, overlook a constraint, or spend too long polishing a minor detail.
A smaller flowchart doesn’t prove we’ve built a better product.
We need to compare the artifacts produced by each approach, the corrections users have to make, the time required to finish, and the cost of execution. The relevant question isn’t how much orchestration code we’ve removed; it’s whether the new system handles the work better.
For each capability we migrate, we want to know whether the agent can complete the supported task with the right evidence, preserve required content, produce a usable artifact, and make unfinished work visible.
If a small, fixed sequence handles that task more reliably, we'll keep the sequence.
// solstice.eng
All posts →
