/\ ATFGraph /docs
README Downloads
Examples / ATFGraph
Framework reference

This article is retained from the existing framework docs. Self-hosting commands and server-admin access differ from the managed CLI workflow. Start with Get started for the installed product.

On-demand node

Directory examples/python/on_demand_node

Run a node for a bounded invocation instead of keeping its worker alive permanently. Prepare the SDK and CLI from the repository root:

Agent node label on-demand-node, version 1.0.0.

Capabilities

CapabilityKindSignatureModuleSummary
hellotraversal(name: str = 'ATFGraph') -> dictexamples/python/on_demand_node/agent.py
ping_childtraversal(target: str, message: str) -> dictexamples/python/on_demand_node/agent.py

Commands

Taken from this example's own README and module docstrings.

atfg server start
atfg traverse on-demand-node.hello --in '{"name":"Ada"}'
cargo build --bin atfgraphd --bin atfg
python -m atfgraph.worker --module examples.python.on_demand_node.agent:app
python -m examples.python.on_demand_node.call --discover
python -m examples.python.on_demand_node.call hello '{"name":"Ada"}'
python -m examples.python.on_demand_node.call ping_child '{"target":"on-demand-node.hello","message":"Ada"}'
python -m pip install -e ./python

Files

  • examples/python/on_demand_node/README.md
  • examples/python/on_demand_node/__init__.py
  • examples/python/on_demand_node/agent.py
  • examples/python/on_demand_node/agentnode.yaml
  • examples/python/on_demand_node/call.py
  • examples/python/on_demand_node/requirements.txt

README

Rendered from examples/python/on_demand_node/README.md; the source file is not modified.

Run a node for a bounded invocation instead of keeping its worker alive permanently. Prepare the SDK and CLI from the repository root:

python -m pip install -e ./python
cargo build --bin atfgraphd --bin atfg
export PATH="$PWD/target/debug:$PATH"
atfg server start

Connect to the default local server at http://127.0.0.1:18880, or configure another server and API key. Inspect recorded work in its /ui/ Console.

python -m examples.python.on_demand_node.call --discover
python -m examples.python.on_demand_node.call hello '{"name":"Ada"}'
python -m examples.python.on_demand_node.call ping_child '{"target":"on-demand-node.hello","message":"Ada"}'

Each invocation starts an outbound worker, submits and claims a real traversal, and returns the server's result/path. ping_child adds a child call, which can target another registered node if that node has a serving worker. No inbound execution callback is required.

A function runtime can call agent.handler(event, context) with an invoke event containing capability and input. It also accepts discover, serve for queued work, and drain. Configure server credentials and network egress in the runtime. These local examples do not provision cloud functions or their provider-specific triggers.

For comparison, run the same node as a normal long-running worker:

python -m atfgraph.worker --module examples.python.on_demand_node.agent:app
atfg traverse on-demand-node.hello --in '{"name":"Ada"}'
ATFGraph documentationHosted workflow · Framework reference