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
| kind | Required fields | Optional fields | Description |
|---|---|---|---|
| item | url | label, constraints | Purchase the product at the given URL |
| signup | url | label | Create an account and store credentials |
| goal | url, intent | label | Open-ended — agent decides how to accomplish the intent |
| one-of | options[] | — | Agent picks exactly one from the alternatives |
| all-of | items[] | — | Agent completes every item in sequence |
one-of and all-of accept any BuyNode as children — they can be nested.
Constraints (item only)
| kind | Fields | Description |
|---|---|---|
| max-price | cents (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