The Right Mental Model
Lamina apps are not single-shot utility functions. An agent should treat Lamina as a system with:- discoverable app capabilities
- explicit input contracts
- asynchronous execution
- webhook-based or polling-based result delivery
- typed outputs
Recommended Agent Flow
Inspect the chosen app
Use
GET /v1/apps/{appId} before execution so the agent knows the exact parameter names and allowed option labels.Construct inputs from app metadata
Build the
inputs object using the returned parameter names exactly as provided.Start execution with webhook
Call
POST /v1/apps/{appId}/executions?webhook=<your_url> and store the returned executionId.Always Inspect Parameters First
Before executing an app, an agent should fetch app metadata unless it already has fresh metadata cached for that exactappId.
This is important because the app metadata is the source of truth for:
- parameter names
- whether fields are required
- valid
optionslabels - whether a field expects a media URL
Use Parameter Names Exactly
When callingPOST /v1/apps/{appId}/executions, inputs should be keyed by parameter name.
Example:
Handle options Carefully
For parameters of type options, send one of the labels returned by the app metadata.
If the app says the valid options are:
Use Webhooks For Production
For production agent integrations, always use webhooks instead of polling:- No polling loop to manage
- Results arrive immediately when ready
- Signed with ED25519 — verify authenticity
- Automatic retries if your endpoint is temporarily down
Webhook Payload Structure
The webhook payload matches the polling response exactly:Read Output Type Before Consuming Value
Do not assume every output is an image URL. Check:typestatusvalue
imagevideotextpending
Handle Failures Explicitly
If execution fails:- inspect top-level
errorMessage - inspect each output’s
error - avoid blindly retrying the same invalid inputs
Good Agent Behaviors
- discover before execute
- cache app metadata briefly, but refresh when uncertain
- use webhooks for result delivery
- preserve
executionIdfor later retrieval - branch logic on output
type - verify webhook signatures
- surface execution failure with the returned error details
Poor Agent Behaviors
- guessing parameter names from natural language
- sending internal option IDs that were never returned by the API
- treating execution as synchronous
- resubmitting the same long-running request repeatedly because output is not immediate
- ignoring webhook signatures