Flowglad — CLI Reference

BuyNode DSL

The BuyNode tree describes what the agent should purchase or sign up for. Pass it as inline JSON or a @file.json path to fgp order.

Node types

kindRequired fieldsOptional fieldsDescription
itemurllabel, constraintsPurchase the product at the given URL
signupurllabelCreate an account and store credentials
goalurl, intentlabelOpen-ended — agent decides how to accomplish the intent
one-ofoptions[]Agent picks exactly one from the alternatives
all-ofitems[]Agent completes every item in sequence

one-of and all-of accept any BuyNode as children — they can be nested.

Constraints (item only)

kindFieldsDescription
max-pricecents (integer)Abort if the price exceeds this amount

Examples

item — purchase a single product

{
  "kind": "item",
  "url": "https://example.com/pricing",
  "label": "Pro plan",
  "constraints": [
    { "kind": "max-price", "cents": 2900 }
  ]
}

signup — create an account and store credentials

{
  "kind": "signup",
  "url": "https://example.com/signup",
  "label": "Example account"
}

goal — open-ended intent

{
  "kind": "goal",
  "url": "https://example.com/pricing",
  "intent": "Subscribe to the cheapest plan that includes API access",
  "label": "Example Pro"
}

one-of — agent picks the best option

{
  "kind": "one-of",
  "options": [
    { "kind": "item", "url": "https://vendor-a.com/pricing", "label": "Vendor A" },
    { "kind": "item", "url": "https://vendor-b.com/pricing", "label": "Vendor B" }
  ]
}

all-of — complete every item in order

{
  "kind": "all-of",
  "items": [
    { "kind": "signup", "url": "https://example.com/signup" },
    { "kind": "item",   "url": "https://example.com/pricing", "label": "Pro plan" }
  ]
}

CLI usage

# Inline JSON
fgp order '{"kind":"item","url":"https://example.com/pricing"}' --max-spend 2900

# From a file
fgp order @order.json --max-spend 5000

# Dry-run (validate without creating a job)
fgp order @order.json --dry-run