Skip to main content
The Traverse Edge stage follows object edges — typed, directed, customer-owned relationships stored on a document — to fetch the documents they point to. Starting from the documents in the pipeline, it reads each document’s root-level edges, filters by edge type and direction, and returns the linked documents (carrying the edge’s attributes with each result).
Stage Category: APPLY (relationship traversal)Transformation: N documents → M linked documents (optionally including the originating documents)
Edges are saved onto documents at ingestion — for example, an assembled ad linked to every piece of footage it uses (see Iconik project-file linkage). Traverse Edge is how you follow those saved relationships at query time instead of recomputing them.

When to Use

Use CaseDescription
Footage ↔ ad linkageFrom an ad, fetch every footage clip it uses (with clip order + start-ticks); from footage, find the ads that use it
Bill-of-materials / compositionFollow “part-of” relationships from an assembly to its components
Reference expansionPull the documents a result explicitly links to, without a similarity search
Graph hopsWalk saved relationships between entities you’ve modeled as edges

When NOT to Use

ScenarioRecommended Alternative
Similarity / semantic matchingfeature_search
Joining by a shared field valuedocument_enrich
Comparing content across collectionscross_compare
Filtering on an attributeattribute_filter

How it works

  1. For each document entering the stage, the stage reads its root-level edges list.
  2. Edges are kept when their type matches edge_type and their direction matches the configured direction.
  3. Each kept edge’s target_object_id is resolved to the linked document(s); with target_collection_id set, only documents from that collection are returned.
  4. Matched documents are returned with the originating edge’s attributes attached (e.g. clip_order, start_ticks_in/start_ticks_out), so downstream stages can use them.
Because edges are stored reciprocally (an edge and its inverse can be written on both endpoints), you can traverse the same relationship from either side by choosing the matching edge_type and direction.

Parameters

ParameterTypeDefaultDescription
edge_typestring | string[]RequiredEdge type(s) to follow, e.g. "uses_footage" or ["uses_footage", "used_in_ad"]
directionstringanyWhich edge directions to follow: out, in, or any
target_collection_idstringnullOnly return traversed documents from this collection (else all collections)
include_sourcebooleanfalseAlso keep the originating documents in the output
max_per_sourceinteger50Max edges to follow per source document (guards fan-out)
limitinteger200Max total traversed documents to fetch across all sources

Example

Starting from an ad document, fetch every piece of footage it uses:
Each returned footage document carries the edge attributes from the ad that referenced it — clip_order, start_ticks_in, and start_ticks_out — so you know exactly where in the footage each clip was taken.
  • Objects — how edges are stored on objects and flow to documents
  • Iconik integration — how footage↔ad edges are captured at ingestion
  • Cross Compare — match content across collections by similarity instead of saved edges