Skip to contents

Connects two nodes. With when = NULL the edge is unconditional; with a predicate when = function(state) -> logical it is taken only when the predicate holds. After a node, the runtime takes the first outgoing edge whose predicate is TRUE (or the unconditional edge). A back-edge forms a loop, bounded by max_steps in run_workflow().

Usage

add_edge(wf, from, to, when = NULL)

Arguments

wf

An agent_workflow.

from, to

Node names.

when

Optional function(state) -> logical.

Value

The workflow, with the edge added.