Documentation Index

Fetch the complete documentation index at: https://docs.unqork.io/llms.txt

Use this file to discover all available pages before exploring further.

Implementing Logic with Build Agent

Prev Next

The Build Agent handles logic implementation in your modules. Describe what the logic should do in plain language, and the agent creates the appropriate components, configures the logic, and wires the inputs and outputs.

Use the agent to do the following:

  • Filter, transform, or aggregate submission data.

  • Calculate values based on end-user input or API responses.

  • Group, sort, or join data from multiple sources.

  • Chain multi-step operations across a module.

How the Agent Implements Logic

For most logic tasks, the Build Agent creates a Logic Smart Component: a Smart Component built and configured to handle data processing, calculations, and conditional operations. Logic Smart Components are agent-created components. They do not appear in the component tray and are not manually configurable the same way standard components are.

For simpler operations, or when a task calls for a specific standard component, the agent might use Calculator, Decisions, or Data Workflow components instead. If you want a specific component, name it in your prompt and the agent will use it.

The agent chooses the approach that best fits the task. In practice, most logic prompts produce a Logic Smart Component.

What the Agent Can Read

The agent maps input sources automatically based on your prompt. Understanding what data is available helps you write more precise instructions.

Component Values

The most common input source is a component's value, referenced by Property ID. Each component stores its value as a specific data type: string, number, boolean, array, or object. See the Data Types Reference for a full list of components and their value types.

Hidden components are useful for storing intermediate results from previous logic steps or API responses for further processing.

Grid Data

The agent can use data from grid components in the following two ways:

  • Entire grid: All rows as an array of objects. Use this for filtering, grouping, sorting, or aggregating across the full dataset.

  • Specific cells: A particular row and column, targeted using dot notation in the input ID.

Specify which mode you need when writing your prompt. A prompt requesting all data from an orderItems grid uses the full grid. A prompt requesting the value in row 2 of the price column targets a specific cell.

Plug-In Component Output

Logic components are commonly placed after a Plug-In component in the execution chain. The Plug-In component calls an external API, stores the response in a Hidden component, and the logic component transforms the result.

Reference the Hidden component storing the API response as the input when prompting the agent.

What the Agent Can Write

The agent configures outputs based on your prompt, mapping the result to specific component properties.

type

Description

Set a value

Write a calculated or transformed value to any component that accepts a value. The standard pattern for storing results or populating visible fields.

Control visibility

Show or hide a component based on logic output. For example, display a warning when a total exceeds a threshold.

Enable or disable fields

Enable or disable input components based on logic results.

Set validation rules

Apply dynamic validation rules that depend on runtime data instead of fixed settings.

Update labels

Overwrite a component's label or displayed text with a dynamically generated value.

Clear fields

Reset components to an empty or default state after an operation completes.

Trigger other components

Chain subsequent actions using Post Trigger after the logic component finishes.

Execution Control

Trigger Type

Trigger

Behavior

When to use

Manual

Runs only when explicitly triggered by another component.

Default. Predictable and performant; runs only when needed.

Watch

Runs automatically when any watched component changes value.

Use sparingly. Helpful for real-time calculations, but running complex pipelines on every keystroke can degrade performance.

Use Manual unless you have a specific reason for Watch. When using Watch mode, specify which components to watch. A broad watcher list increases execution frequency.

Chaining

After the logic completes, the agent can configure the following:

  • Post Trigger: Triggers a component immediately after the logic completes successfully. Use to sequence multiple logic steps or  a Plug-In component after processing.

  • Error Trigger: Triggers a component when the logic fails. Recommended for any logic that processes API data or runs complex transformations.

Writing Effective Prompts

The quality of the generated logic depends directly on the specificity of your prompt. Vague prompts produce generic results. Specific prompts produce accurate, well-configured logic on the first attempt.

Specify Inputs by Property ID

Reference components by Property ID, not by label or description.

Vague: Calculate the total.

Specific: Use the data from the orderItems grid to calculate totals.

Describe the Transformation Step by Step

For multi-step logic, separate the description into individual operations in the order they should run.

Vague: Process the order data.

Specific: Filter the orderItems grid to rows where status equals 'approved'. Sum the lineTotal column across those rows. Output the result to approvedTotal.

Specify Where the Output Goes

Always name the destination component. Without a clear output target, the agent might create a new Hidden component instead of writing to an existing one.

Output the result to the existing invoiceTotal Text Field component.

Describe Conditional Logic

If the logic should behave differently depending on runtime state, describe each condition explicitly.

When the discountCode field is not empty, apply the discount percentage from discountPercent to the subtotal field. When discountCode is empty, copy subtotal directly to finalTotal.

Describe the Trigger

Tell the agent what should cause the logic to run.

Trigger the logic when the Creator clicks the Calculate button (btnCalculate).

Run automatically whenever the quantityInput or priceInput field changes.

Example Prompts

Filtering grid data:

Create a logic component that filters the products grid to show only items where stock is below 10, and outputs the results to the lowStockItems Hidden component.

Calculating a total:

Calculate the total invoice amount by summing the lineTotal column from the invoiceItems grid and output the result to invoiceTotal.

Conditional calculation triggered by Creator interaction:

When the Creator selects a product from the productSelect drop-down, calculate the discounted price as (productPrice multiplied by (1 minus discountPercent divided by 100)) and display the result in the finalPrice Text Field component.

Complex Scenarios

Multi-Step Logic

For operations that require sequential transformations, describe each step in order. The agent creates the necessary logic components and wires them together through Hidden components.

First, fetch the product catalog from the API. Then filter the catalog to the selected category. Finally, calculate the total value of matching items.

Conditional Operations

When logic branches based on runtime data, describe each condition and its corresponding outcome.

If orderType equals 'priority', apply a 10% surcharge to subtotal and output to adjustedTotal. If orderType is anything else, copy subtotal to adjustedTotal unchanged.

Large Grid Datasets

When working with large grids, apply filtering before transformations to reduce the dataset first. Mention the performance requirement in your prompt.

Filter the lineItems grid to rows where status equals 'approved' before calculating totals. The grid may have several hundred rows, so performance matters.

Object Transformations

When the logic must reshape an object, copying some fields, renaming others, or adding calculated fields, describe the transformation field by field.

Take the API response from productApiResult and create a new object with only the id, name, and price fields. Add a calculated field called priceWithTax that multiplies price by 1.08. Output the result to productDisplay.


Changelog

Date

Change

2026-07-09

Updated to reflect Logic Block as the Build Agent's primary logic component. Removed pipeline language.

2026-05-25

Initial publication. Replaces Working with Logic Composer: reframed for agent-only logic implementation.