Skip to main content
What this builds. A pipeline that takes a JSON string as input, extracts the hello and hi keys via ReadJsonValuesNode, and exposes them as two separate output nodes. You’ll end up with. A re-saved pipeline (fetched by id) with result returning the full extracted-values dict and result_2 returning just the value at hello.
import vectorshift
from vectorshift.pipeline import Pipeline, InputNode, OutputNode, ReadJsonValuesNode

pipeline = Pipeline.fetch(id="698d6768a07ed4bec88d7aed")

pipeline.nodes.clear()

string_input = InputNode(node_name='query', input_type='string')

read_json_node = ReadJsonValuesNode(
    json_string=string_input.text, keys=["hello", "hi"], processed_outputs={}
)

output_node = OutputNode(
    node_name='result',
    output_type='string',
    value=read_json_node.json_values,
)

output_node_2 = OutputNode(
    node_name="result_2", output_type="string", value=read_json_node.hello
)

pipeline.nodes = [string_input, read_json_node, output_node, output_node_2]
pipeline.save()

Expected output

This script does not print anything — successful execution simply re-saves the pipeline. Run it against an input like {"hello": "world", "hi": "there"} and inspect outputs in the dashboard.

See also

Create-list pipeline

Build a list inside a pipeline instead of parsing one out.

Text processing pipeline

Combine and reformat strings between nodes.

Pipeline reference

Full method surface.