Skip to main content

Test one block with Execute step

Goal

Iterate on a single code block in seconds, without triggers or a new entry on Runs. Time: 10 minutes.

Code node editor with sample input, parameters, and output panels Code node editor with sample input, parameters, and output panels

Steps

  1. Select a Code block and choose Open code editor.
  2. Type JSON or plain text in Step input.
  3. Choose Execute step. Only this block runs. The output panel shows stdout, errors, and published properties.
  4. Copy output copies everything in that panel.
  5. Save the workflow to keep the sample as input_sample.

How Step input becomes the input file

You typeTERMORQ_INPUT file contains
A JSON object, array, number, boolean, or nullThat JSON
Plain text (including a JSON string value)Raw text. It’s also available as inputs.text and trigger.text
Nothing{}
Text starting with { or [ that isn’t valid JSONRejected
Important

In Execute step, Step input is the file. It isn’t built from uses. To reproduce a full run, type the same nested shape that uses would produce, for example {"trigger":{"text":"Hello"}}, not {"text":"Hello"}.

input_sample in YAML

- id: echo
  kind: code
  language: python
  uses: [trigger.text]
  input_sample: |-
    {"trigger":{"text":"Hello from curl"}}
  body: |
    import json, os
    data = json.load(open(os.environ["TERMORQ_INPUT"], encoding="utf-8"))
    print(json.dumps({"message": data["trigger"]["text"]}))
  outputs:
    type: object
    properties:
      message: { type: string }

input_sample is a test fixture. A trigger or a full run never uses it as a default. A passing Execute step doesn’t prove that the real trigger supplies every path in uses.

Check your run

Execute step shows message: "Hello from curl", and the Runs tab gets no new entry.

Exercise

Type the plain text Hello (without quotes) into Step input. The block above fails. Change the body so it handles both the nested JSON shape and plain text.

Details
import json, os
raw = open(os.environ["TERMORQ_INPUT"], encoding="utf-8").read()
try:
    text = json.loads(raw)["trigger"]["text"]
except (ValueError, KeyError, TypeError):
    text = raw
print(json.dumps({"message": text}))
Note

Execute step is available for inline Code blocks. AI blocks have the equivalent Open AI editor (Stage 4). Test Code file blocks with a full run.