> ## Documentation Index
> Fetch the complete documentation index at: https://trickest.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Building and Debugging a Workflow

> Add a node to the canvas, configure it, run it, and inspect inputs/outputs to validate behavior before you connect additional steps.

## Overview

Workflows are built incrementally. Start with a single node, verify it behaves as expected, and then expand the workflow by connecting additional nodes.\
This guide covers single-node execution and basic debugging using the node run view.

***

## 1. Add a Node on the Canvas

Workflows are made of **nodes**. Each node is a **tool** (a packaged binary like `subfinder` or `httpx`), a **script**, or a **module** (a reusable mini-workflow). For this guide you will use **subfinder**, a passive subdomain enumeration tool, as the first node, then add **httpx** to probe the discovered subdomains.

<Steps>
  <Step title="Open the Add node menu">
    Click **Add node** in the top-right of the canvas. A search panel opens listing tools, scripts, and modules.
  </Step>

  <Step title="Add the subfinder node">
    Type `subfinder` in the search box, then click the result (or drag it onto the canvas). A new **subfinder** node appears.
  </Step>
</Steps>

***

## 2. Configure and Run a Single Node

You can run any node on its own to verify it works before connecting it to anything else. This is the fastest way to iterate on a single step.

<Steps>
  <Step title="Open the node run view">
    Double-click the **subfinder** node on the canvas. The node run view opens. The left panel lists the node's parameters; the center area shows the generated command, run controls, and (after the node runs) the inputs and outputs of that run.
  </Step>

  <Step title="Set the domain to enumerate">
    In the parameter list, find `domain` and enter `trickest.com` (or any domain you are authorized to scan). For `subfinder`, `domain` is the only required input; everything else can stay at its defaults.
  </Step>

  <Step title="Run the node">
    Click **Run** at the top of the node run view. The node enters the running state, and the **Command** preview shows the actual command that will execute (for example, `subfinder -d trickest.com`).
  </Step>
</Steps>

While the node is running and after it finishes, you can monitor in the same view:

* The **Command** generated from your parameters
* The **Inputs** resolved for the run
* The **Outputs** produced. For `subfinder`, this is a list of discovered subdomains, one per line.

> **Note** Parameters can have one of several types: **String** (text input), **File** (upload, paste a URL, or pick a file you uploaded earlier), **Folder** (a folder of files), or **Flag** (boolean toggle). Required parameters are marked; optional ones can be skipped.

> **Note** You can close the node run view at any time. The execution state is preserved, and you can reopen the view by double-clicking the node again.

***

## 3. Validate Results and Iterate

Use the **Outputs** panel to confirm the node behaved as expected before you build on top of it.

For the `subfinder` example, you should see one or more subdomains listed. For `trickest.com`, expect entries like `app.trickest.com`, `docs.trickest.com`, and similar. If the output is empty or much smaller than you expected:

* Double-check that the `domain` value is spelled correctly and has no extra whitespace
* Confirm the domain has discoverable subdomains (some private domains return nothing)
* Adjust optional flags (for example, sources to use) and re-run

> **Tip** When iterating on configuration, change one parameter at a time so it is clear what affected the output.

***

## 4. Add and Connect a Downstream Node

Once a node produces the output you expect, add a second node and connect it to the first one. Here you will add `httpx` to take the subdomains discovered by `subfinder` and probe which ones respond over HTTP.

<Steps>
  <Step title="Add the httpx node">
    Click **Add node** again, search for `httpx`, and add it to the canvas next to the **subfinder** node.
  </Step>

  <Step title="Draw a connection">
    Drag from the output handle of the **subfinder** node to the input handle of the **httpx** node. A picker appears asking which input parameter on **httpx** should receive the upstream output.
  </Step>

  <Step title="Map the connection to -list">
    Pick `-list` from the picker. `httpx` reads its targets from the file passed to `-list`, so the subdomains produced by `subfinder` flow into it as a file input.
  </Step>

  <Step title="Confirm the mapping">
    Double-click the **httpx** node to open its run view. The `-list` parameter is now bound to the upstream node's output, and the **Command** preview reflects this (for example, `httpx -list <subfinder output>`).
  </Step>

  <Step title="Run httpx">
    Click **Run**. The **Outputs** panel will show the responding hosts, typically with status codes such as `200`, `301`, or `403`.
  </Step>
</Steps>

> **Note** The platform supports memoization. If a node's configuration and inputs are unchanged from a previous run, the platform can reuse the previous result instead of re-executing.

***

## 5. Continue Building

At this point you have a working two-step workflow:

1. `subfinder` generates subdomains
2. `httpx` processes the discovered subdomains

You can continue building in the same way:

* Add another node, run and validate outputs incrementally
* Configure inputs/parameters
* Execute (or Schedule) workflow to get fresh run of the whole workflow

***

## 6. Restore a Past Run's Version

While iterating, you may want to revert the live workflow to the version that produced a previous run (for example, a known-good run before a change broke something). Use **Restore** to replace the live workflow with the version recorded for that run.

<Steps>
  <Step title="Open the run">
    Open the run from the **Runs History** sidebar in the editor, or from the **Workspace Runs page** (see [Working with Runs](./working-with-runs)).
  </Step>

  <Step title="Locate the Restore button">
    The **Viewing run** banner appears at the top of the canvas. If the run uses a different workflow version than the live one, **Restore** is shown next to **Back to editor**.
  </Step>

  <Step title="Restore the version">
    Click **Restore**. A confirmation dialog appears: *"Restore to this version? This will replace the current workflow with the version from this run. Any unsaved changes will be lost."*
  </Step>

  <Step title="Confirm">
    Click **Restore** to apply, or **Cancel** to keep the current workflow.
  </Step>
</Steps>

> **Note** Restore only appears when the run's workflow version differs structurally from the live workflow. Position-only changes (moving nodes on the canvas) do not trigger it.

> **Note** Restore replaces the **workflow definition**. It does not re-run the workflow and does not copy the run's input values onto the live workflow.

> **Tip** Unsaved local changes are discarded by Restore. If you want to keep them, save or duplicate the workflow first.

***

## Next Steps

Once you are happy with the single-node results, you can continue by connecting additional nodes to build a full workflow.
