import type { ParsedWorkflow, ParsedNode } from './types.js'; export type NextValue = string | string[] | Record; export interface NodeTopology { next?: NextValue; onError?: string | string[]; /** nodeId of the (first) predecessor — resolves `$json` references. */ predecessorNodeId?: string; /** * All graph-node predecessors, in connection order — the multiple input * streams that feed a join node (n8n Merge). `predecessorNodeId` stays the * first for `$json` resolution. */ predecessorNodeIds?: string[]; } export interface Topology { /** Main-flow nodes that become graph nodes, in declaration order. */ graphNodes: ParsedNode[]; /** Per graph nodeId: next/onError/predecessor. */ byNodeId: Record; entryNodeIds: string[]; nameToNodeId: Record; /** * Rewrite map for references that point at a non-graph node. A No Op is a * passthrough, so `$node["NoOp"].json.x` must resolve to the No Op's upstream * graph-node data source — or the implicit `trigger` input when the No Op is * an entry (fed only by triggers/other noops). Values are terminal nodeIds * (`'trigger'` or a graph nodeId), so no further resolution is needed. */ refRewrite: Record; } export declare function buildTopology(parsed: ParsedWorkflow): Topology;