Updated Sep 21, 2026

Utilities

Query and convert structured files with yq

Use one expression language across YAML, JSON, XML, TOML, and properties.

Agent

overview

What yq does

Connect a structured file and set the yq expression to evaluate. The node writes the selected value or transformed document to a workflow output file, using the same expression syntax as Mike Farah's yq v4.

-p selects the input format when filename detection is not enough. -o controls the result format, so a YAML input can become JSON without a separate conversion step. -n evaluates an expression without reading an input document.

The wrapper stages output in the destination directory and moves it into place only after yq succeeds. Invalid syntax and parse errors fail the node instead of publishing partial content.

source github.com/mikefarah/yq

use cases

Where yq fits

Read deployment settings

Select a nested value or object from a YAML configuration file.

Convert YAML to JSON

Set -o to json and return the selected document as JSON.

Generate a document

Enable -n to build YAML or JSON from an expression without an input file.

reference

yq inputs and flags

5 inputs
NameTypeFlagDescription
expressionSTRING--expressionyq expression to evaluate.
inputFILE--inputYAML, JSON, XML, TOML, or properties file.
output-formatSTRING--output-formatOutput format such as yaml or json.
input-formatSTRING--input-formatExplicit input format when needed.

Showing key inputs. yq exposes 5 inputs in total.

Full flag reference (5 inputs)
NameTypeFlagDescription
input-formatSTRING--input-formatInput format such as yaml, json, xml, or toml
output-formatSTRING--output-formatOutput format such as yaml, json, xml, or toml
null-inputBOOLEAN--null-inputEvaluate without an input file
expressionSTRING--expressionyq expression to evaluate
inputFILE--inputYAML, JSON, XML, TOML, or properties input file

example

Run yq

yq · command
yq -o json '.service' input.yaml
sample output
{  "name": "alpha",  "enabled": true}

guidance

Choosing yq

Use yq for YAML, XML, TOML, properties, or mixed-format conversion. Use jq when every input is JSON, and Miller when tabular records are the main unit.

jq

The focused choice for JSON filtering and transformation.

miller

Better suited to CSV, TSV, and streams of records.

duckdb

Uses SQL for larger datasets and multi-file queries.

faq

yq questions

It is Mike Farah's Go-based yq v4, not the Python wrapper around jq.

Run yq yourself

A YAML service object feeds yq with .service and -o json, producing a JSON object for the next node.

Facts on this page come from the live Trickest tool library.