Layer Workflow Import
Overview
Read what the source does, rebuild it from Layer's node kinds, and hand the whole graph to
import_workflow. The result is always private; sharing is a separate step in the Layer app. To run
a workflow that already exists, use layer-workflows. The spend gate and polling rules live in the layer skill.
If a sibling skill named here is missing from your available skills, ask the user to install it
(npx skills add layerai/skills --skill <name>); unattended, proceed from tool schemas and flag the
gap.
Translate intent, not nodes
Other tools expose the machinery; Layer exposes the task. A low-level text-to-image graph is a model loader, a text encoder per prompt, an empty latent, a sampler and a decoder. In Layer that is one generate node. Read what goes in, what each step does, and what comes out, then use the fewest Layer nodes that do the same job.
How to read an unfamiliar source, and what common node patterns mean, is in references/sources.md [blocked].
Quick reference
The graph
graph is an open object with three maps: inputs (parameter key to input parameter), nodes (node
id to node) and outputs (parameter key to output parameter). No public surface defines the fields
inside them, so do not assume a shape. Node kinds, port keys, port types and value schemas come from
get_blueprint_system_config; validate_only names whatever is missing or misnamed.
There is no edge list. Whatever is fed names its source in refs, {"_default": [...]}, holding
nodes::<node id>[<kind key>]::<port key> for a node output or blueprint::<input key> for a
workflow input.
An output of type A may feed an input of type B only when A equals B or (A, B) is a casting rule. A
rule carrying a transformer is blocked, not allowed: insert the named transformer node kind between
the two and wire through it.
Static values must conform to their type's JSON schema in the system config. Where a port selects a
model, discover it with list_base_models filtered by the use case that node serves.
The loop
get_blueprint_system_configfor the workspace.- Read the source and write down inputs, steps and outputs in plain words.
- Map each step to a node kind. When nothing fits, stop and tell the user which step has no Layer equivalent, rather than approximating it with an unrelated node.
- Build the graph, then
import_workflowwithvalidate_only: true. The result groups problems by node, input and output. Fix and repeat untilis_validis true. import_workflowfor real, with a clearnameand adescriptionthat says where it came from. Passproject_idwhen the user wants it filed in a project.- Prove it: upload a sample for each file input,
estimate_workflow_price, confirm above 20 CUs, thenexecute_workflowwith asession_nameand poll. A graph that validates can still produce the wrong thing; look at the output. - Report: the workflow id, what was mapped to what, and anything dropped or approximated.
publish: false keeps a draft instead of a runnable workflow, and is accepted even with validation
problems. Use it only when the user wants to finish the graph by hand in the editor.
Worked example
"Import this workflow." The user attaches a node-graph JSON: a top-level nodes list and a links
list of [link, from node, from slot, to node, to slot].
- Reading it: a checkpoint loader, a pixel-art style adapter, positive and negative text encoders, an empty 1024x1024 latent, a sampler, a decoder, a 2x upscale and a save node.
- Intent: text in, pixel-art image out, upscaled 2x. Inputs: the prompt. Fixed: size, the style.
get_blueprint_system_config, then pick generate-image and upscale node kinds whose ports fit. If the generate kind has a style port, checklist_reference_setsfor a pixel-art set; otherwise fold the style into the prompt.list_base_modelswith the text-to-image use case; take the first result for the generate node.- Graph: input
prompt; the generate node's prompt port refsblueprint::prompt; the upscale node's image port refsnodes::<generate id>[<generate kind>]::<image port>; an output refs the upscale node's output. validate_onlyreports the upscale node's image port as the wrong type. The casting rule for that pair carries atransformer, so it is blocked: insert that transformer node kind and wire through it.- Import, estimate (6 CUs), execute with a
session_nameand a sample prompt, poll, and check the image is upscaled and pixel-styled. - Report: "Imported as a private workflow. The sampler, latent and decoder plumbing became one generate node. The style adapter became a reference set. The negative prompt was dropped: the chosen model has no negative prompt port."
Common mistakes
- Copying a checkpoint or weights file name into a model port instead of discovering a
base_model_id. - Inventing field names inside
graphinstead of taking them from the system config and validation. - Wiring a pair whose casting rule carries a
transformerinstead of routing through that node kind. - Silently approximating a step Layer has no node for. Say which step and why.
- Promising the workflow is shared. It is private; sharing happens in the Layer app.
- Skipping the test run. Validation checks wiring, not whether the output is right.


