AptlyStar

Best Practices

Patterns that keep connections readable and workflows resilient as they grow beyond a handful of blocks.

Name Blocks for Their Tags, Not Their Position

Block names become the identifier in every connection tag that references them (<blockName.field>). Names are normalized to lowercase with spaces stripped, so My Agent and myagent resolve identically — but two blocks with names that normalize to the same string become ambiguous. Rename blocks to describe what they do (fetchUser, summarizeAgent) rather than leaving default names like Agent 2, especially once a workflow has more than a few blocks.

Verify Output Shape Before Wiring Downstream

Don't assume a block's output structure from memory — check it during development. Response formats, custom output modes, and third-party API responses can all deviate from a block type's documented default (see Data Structure). Run the block once, inspect its actual output in the execution logs, and only then wire the exact fields you saw into downstream connection tags.

This matters most for Agent blocks with a custom response format and API blocks calling external services — both produce output shaped by something outside the workflow itself.

Prefer a Response Format Over Parsing Free Text

If a downstream block needs specific structured fields from an Agent block's output, configure a response format schema on that Agent block instead of parsing <agent1.content> as text downstream. A schema-constrained output is stable across runs; extracting fields from free-form text is not.

Use the Error Path for Fallback Logic

Every block's connections can include a separate error edge. Route it to a dedicated fallback or notification block instead of letting a failed block silently stop the workflow. This keeps recovery logic out of your main success path, so the happy-path connections stay easy to read.

Keep Reference Chains Shallow

A connection tag can reach as many levels deep as the source data has (<block1.data.results[0].nested.value>), but a long chain repeated across many downstream blocks is fragile — one upstream schema change breaks every reference at once. When the same nested value feeds three or more blocks, extract it once with a Function block or a workflow Variable, then reference that single, shorter tag everywhere else.

Reuse Values with Workflow Variables

If a value is used by multiple blocks and doesn't change during a run — an API base URL, a shared threshold, a feature flag — set it once as a workflow variable (<variable.name>) rather than re-deriving or re-referencing the same source block repeatedly. It gives you one place to change the value and makes the dependency explicit.

Separate Secrets from Workflow Data

Never pass API keys, tokens, or credentials through block-to-block connections. Use personal or workspace environment variables ({{VAR_NAME}}) for anything secret — they're resolved separately from workflow data and aren't exposed in execution logs the way a block's output value is.

Design for Skipped Branches

Blocks behind an unselected Condition or Router path don't execute, and any tag referencing them resolves to an empty value rather than an error. If a downstream block might run regardless of which upstream branch fired, make sure its logic handles an empty or null reference gracefully instead of assuming a specific branch always ran.

Common Questions

Add one wherever a failure should be handled explicitly rather than stopping the run — external API calls, file operations, or any block whose failure shouldn't take down the whole workflow. For simple internal blocks where any failure genuinely means the workflow should stop, an error edge just adds unused complexity.
Use a Function block when you need to transform, filter, merge, or validate data — not just pass it through. If you find yourself repeating the same nested reference path in multiple blocks, or the destination field can't consume the source's raw shape, that's a sign to normalize the data once in a Function block first.
This page covers connection-level practices rather than workflow architecture, but as a rule of thumb: if a section of blocks represents a reusable unit of work, or debugging requires scrolling through many unrelated blocks to find the relevant path, consider extracting it into a Workflow block that can be called separately.
Block names are normalized (lowercased, spaces removed) before matching a connection tag. If two blocks share a normalized name, a tag referencing that name resolves to whichever block the resolver finds, which may not be the one you intended. Rename one of the blocks to a distinct value to fix it.
Use workspace environment variables for values the whole team should share, like a shared API base URL. Use personal environment variables for anything scoped to an individual user, like a personal API key. If a personal and workspace variable share the same name, the personal one takes priority for that user's runs.

On this page