Complete configs
Three whole configs to start a first station from: copy the closest to what you want, then change it recipe by recipe (Recipes). Core loads each one with no error.
A read-only catalogue
A public API, one operation, one skill whose cards show the pets: nothing is chosen, nothing is filed.
pet-shop-guide.yaml
# A read-only catalogue over a public API — the Swagger Petstore, which anyone may call.
# One API, one operation, one skill whose cards show the pets: nothing is chosen, nothing is filed.
station:
id: pet-shop-guide
name: Pet Shop Guide
global:
language: en
currency: USD
locale: en-US
domain:
domain_type: retail
entity_name: pet
entity_name_plural: pets
voice:
tone: friendly
persona: "a pet shop assistant who knows every animal in the shop"
rules:
- "Never invent a pet or its status: everything comes from the tool."
apis:
- name: petstore
openapi_url: https://petstore3.swagger.io/api/v3/openapi.json
base_url: https://petstore3.swagger.io/api/v3
operations: # nothing else of the API is reachable
- {id: findPetsByStatus, access: read}
auth: {type: none}
profiles: # everything is closed until a profile is granted it
everyone:
when: "true"
grants: [petstore.findPetsByStatus]
skills:
- name: pets
cognitive:
objective: "show the shop's pets with the status the person asks for: available, pending or sold"
params:
status: {type: text, set_by: [llm]}
invoke: {method: findPetsByStatus, args: {status: "$params.status"}}
kinds: {pet: {}}
present:
fields:
name: {from: name, type: text, role: title}
status: {from: status, type: text}
render: {component: cards} # a read with no submit: cards to look at, nothing to choose
A sign-in by e-mail
The person proves their e-mail with a one-time code the tenant sends and checks; the tenant then answers for them, with their own token.
sign-in-by-email.yaml
# A station whose answers depend on who asks: the person proves their e-mail with a one-time code,
# sent and checked by the tenant's own operations. The tenant's check answers with the person's
# token (`credential`), which Convoy keeps sealed with the sign-in and sends on their calls
# (`auth.person`): the tenant then answers for that person. Replace api.example.com by the API.
station:
id: team-hours
name: Team Hours
identity:
providers:
email:
mechanism: otp
verifies: email
type: email
via: tenant
send: sendVerificationCode # the tenant's operation that sends the code
check: checkVerificationCode # the one that checks it and answers with the token
credential: access_token # the field of that answer holding the person's token
global:
language: en
currency: EUR
locale: en-GB
domain:
domain_type: saas
entity_name: team
entity_name_plural: teams
voice:
tone: professional
persona: "an HR analyst who answers with figures, briefly"
rules:
- "Never state an hour that was not measured: every figure comes from the report."
apis:
- name: hours
openapi_url: https://api.example.com/openapi.json
base_url: https://api.example.com
operations:
- {id: listTeams, access: read}
- {id: getOvertimeReport, access: read}
- {id: sendVerificationCode, access: write}
- {id: checkVerificationCode, access: write}
auth:
type: none
person: {provider: email} # the signed-in person's token goes on every call
profiles:
anyone:
when: "$identity.authenticated == false"
grants: [hours.listTeams]
signed_in: # called before signing in, Core asks the person to sign in
when: "$identity.authenticated"
grants: [hours.listTeams, hours.getOvertimeReport]
skills:
- name: teams
cognitive:
objective: list the teams, to choose the one the question is about
invoke: {method: listTeams}
- name: overtime
cognitive:
objective: answer on a team's overtime for a month, and its busiest week
params:
team: {type: text, set_by: [llm]}
month: {type: text, set_by: [llm], required: false}
invoke:
method: getOvertimeReport
args: {team: "$params.team", month: "$params.month"}
render:
component: report
report:
headline: total_overtime_hours
headline_label: "overtime hours"
unit: h
series: weeks
point_label: week_starting
point_value: overtime_hours
A selection, then the submit
The person chooses breads on cards; their confirm files the order through the tenant's write operation, one line per bread. The model never submits.
selection-and-submit.yaml
# A selection the person builds, then submits: they choose breads on cards, and their confirm files
# the order with the tenant's write operation, one line per bread. The model never submits.
# Replace api.example.com by the API.
station:
id: corner-bakery
name: Corner Bakery
global:
language: en
currency: EUR
locale: en-GB
domain:
domain_type: retail
entity_name: bread
entity_name_plural: breads
voice:
tone: friendly
persona: "a baker who knows every loaf of the day"
rules:
- "Never invent a bread or a price: everything comes from the tool."
apis:
- name: bakery
openapi_url: https://api.example.com/openapi.json
base_url: https://api.example.com
operations:
- {id: listBreads, access: read}
- {id: placeOrder, access: write} # a write: only a confirmed submit calls it
auth: {type: none}
profiles:
everyone:
when: "true"
grants: [bakery.listBreads, bakery.placeOrder]
skills:
- name: breads
cognitive:
objective: show the breads of the day, for the person to choose theirs
invoke: {method: listBreads}
kinds: {bread: {}}
present:
fields:
name: {from: name, type: text, role: title}
price: {from: price, type: price, role: billed}
submit:
- name: order
mode: request # filed with the tenant, by its own operation
tool: placeOrder
args:
body.items: "$selection[kind=bread]"
line: {slug: "$line.ref", quantity: "$line.quantity"}
render: {component: cards}
submit_guard:
confirm: true # the person confirms what is filed