Transform JSON with a jq filter
Transform a JSON document by applying a jq program, printing the result to stdout.
Install v1.0.0
Installs the template into your Argo namespace. The URL is pinned to this version.
kubectl apply -n argo -f https://catalog.dagweave.com/api/v1/items/json-transform/1.0.0/template.yaml
Or with the Argo CLI:
argo template create -n argo https://catalog.dagweave.com/api/v1/items/json-transform/1.0.0/template.yaml
Facts
- Category
- Data
- Tags
- data jq
- Entrypoint
transform- Template SHA-256
d08e2e764072a6d0374a1d070897d12eeff06244fee1db0cbbf4a142223f0b05- Source
- json-transform at catalog commit 67458f7
- API
- item document, latest template.yaml
Images and provenance
Every image is pinned by digest, so a rebuilt tag can never change what this version runs.
| Repository | Tag | Digest |
|---|---|---|
ghcr.io/jqlang/jq | 1.8.2 | sha256:b9c68867e5766576263a222e91db3de422d802069c7af70440e667a95344e486 |
Parameters
| Name | Description | Default |
|---|---|---|
input-json required |
The JSON document to transform, as a string. Example {"items":[{"id":1},{"id":2}]} |
none |
jq-filter |
A jq program applied to the parsed input; its output is printed to stdout. Example .items | map(.id) |
. |
WorkflowTemplate
apiVersion: argoproj.io/v1alpha1
kind: WorkflowTemplate
metadata:
name: json-transform
labels:
dagweave.io/catalog-item: json-transform
annotations:
# The catalog semver this manifest was authored at. The dagweave app records
# (catalog-item-id, semver) -> content-hash -> base-vN when it mints the tenant
# cluster name via ResolveOrMint. Keep in sync with metadata.yaml `version`.
dagweave.io/catalog-version: "1.0.0"
dagweave.io/catalog-category: "Data"
spec:
entrypoint: transform
templates:
- name: transform
inputs:
parameters:
# The JSON document to transform, as a string.
- name: input-json
# A jq program applied to the parsed input; its output is printed to stdout.
- name: jq-filter
default: "."
container:
# Pinned by digest per the catalog convention: an image rebuild can never
# silently change the behaviour of an already-released item version.
# ghcr.io/jqlang/jq:1.8.2
image: ghcr.io/jqlang/jq@sha256:b9c68867e5766576263a222e91db3de422d802069c7af70440e667a95344e486
# This is a minimal (shell-less) image whose only binary is /jq, so jq runs
# directly. The untrusted document is read from the INPUT_JSON env var via
# jq's `env` builtin (never interpolated into a shell); the jq-filter is the
# program itself, so it is placed in the argv program string. -n means "no
# input file", -c compact output.
command: [/jq]
args:
- -n
- -c
- "(env.INPUT_JSON | fromjson) | ({{inputs.parameters.jq-filter}})"
env:
- name: INPUT_JSON
value: "{{inputs.parameters.input-json}}"
Version history
Read from the item's changelog. Each version has its own JSON document; the pinned catalogue vendors the manifest of the latest one, so that is the version that installs.
-
1.0.0 latest 2026-07-16
Initial release.
kubectl apply -n argo -f https://catalog.dagweave.com/api/v1/items/json-transform/1.0.0/template.yamlargo template create -n argo https://catalog.dagweave.com/api/v1/items/json-transform/1.0.0/template.yaml
Run it once
After installing, from the command line.
argo submit -n argo --from workflowtemplate/json-transform \
-p input-json='{"items":[{"id":1},{"id":2}]}'
Workflow that references it
A Workflow with the required parameters filled from the examples.
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: json-transform-
spec:
workflowTemplateRef:
name: json-transform
arguments:
parameters:
- name: input-json
value: "{\"items\":[{\"id\":1},{\"id\":2}]}"
As a step of a larger workflow
steps:
- - name: json-transform
templateRef:
name: json-transform
template: transform