Ambassadors (Serverless Functions)
Learn about Ambassadors (Serverless Functions) in WaymakerOS.
Ambassadors are serverless functions deployed through Waymaker Host to a global edge network — 330+ locations worldwide, sub-50ms latency. They run your business logic close to your users — webhooks, scheduled tasks, API integrations, AI-powered automations, and more.
What Are Ambassadors?
Think of ambassadors as your organization's automated agents. They:
- Run on schedule — Check inventory, send reports, sync data
- Respond to events — Process webhooks, handle API requests
- Connect systems — Bridge your Waymaker data with external services
- Think with AI — Extract data, classify content, generate summaries, and process images
- Scale automatically — Run on a global edge network across 330+ cities worldwide
AI Capabilities
Ambassadors have two built-in ways to use AI — choose the one that fits your workload.
One AI (ctx.ai.generate())
The full-power path. Your request is routed through One, which selects the best model for the task. Supports all available models, streaming responses, and compliance-aware routing for regulated industries.
Use One AI when you need:
- Complex reasoning or strategic analysis
- Premium writing quality
- HIPAA-compliant data processing
- Access to the full model suite
Edge AI (ctx.ai.edge())
The fast path. Runs an edge-optimised model directly on the same global network as your ambassador — no round-trip to an external service. Very low latency, very low cost.
Use Edge AI when you need:
- Data extraction from text, forms, or images
- Classification and categorisation
- Summarisation at high volume
- Structured output (get JSON back, not free text)
- Multi-turn conversations (conversation caching makes each turn faster)
Choosing between them
| Question | One AI | Edge AI |
|---|---|---|
| Does it need premium reasoning? | Yes | No |
| Is it processing regulated data (HIPAA)? | Yes | Not supported |
| Is speed more important than depth? | No | Yes |
| Will it run at high volume? | Cost adds up | Built for volume |
| Do I need structured JSON output? | Use prompt engineering | Built-in schema validation |
Both paths track credit usage against your WaymakerOne Pass allocation. See Using AI in Ambassadors for code examples and detailed guidance.
Creating an Ambassador
Required Fields
- name — Used to generate the URL slug
Optional Fields
- repository_url — GitHub repo containing your function code
- repository_branch — Branch to deploy from (default:
main) - function_path — Entry file path within the repo (default:
index.ts) - auth_mode —
required(default),public, orapi-key - schedule — Cron expression for automatic invocation (e.g.,
0 */6 * * *) - workspace_id — Associate with a specific workspace
CLI Example
waymaker host ambassadors create \
--name "weekly-report" \
--repo https://github.com/acme/reports \
--schedule "0 9 * * 1" \
--auth-mode none
MCP Example
"Create an ambassador called weekly-report from my reports repo that runs every Monday at 9am"
Deploying
Trigger a deployment:
waymaker host ambassadors deploy <ambassador-id>
The build runner:
- Checks out your repo
- Builds the serverless function
- Deploys to the global edge network (330+ cities)
- Updates the ambassador status
Invoking Manually
Test an ambassador by invoking it directly:
waymaker host ambassadors invoke <ambassador-id>
This sends a POST request to the ambassador's deployed URL and returns the response.
Viewing Logs
See recent invocations:
waymaker host ambassadors logs <ambassador-id> --limit 20
Each log entry shows:
- Invocation timestamp
- HTTP status code
- Response data (truncated)
- Duration
Authentication Modes
| Mode | Behavior |
|---|---|
required | Requests must include a valid Waymaker auth token |
optional | Auth token is checked if present, but anonymous requests are allowed |
none | No authentication — public endpoint |
Use required for internal APIs, optional for public endpoints that benefit from knowing the user, and none for webhooks and public APIs.
Cron Schedules
Ambassadors can run on a schedule using cron expressions:
| Schedule | Meaning |
|---|---|
* * * * * | Every minute |
0 * * * * | Every hour |
0 */6 * * * | Every 6 hours |
0 9 * * 1 | Every Monday at 9am UTC |
0 0 1 * * | First day of every month |
Ambassador Lifecycle
| Status | Meaning |
|---|---|
pending | Created, not yet deployed |
building | Build in progress |
active | Deployed and running |
error | Last deployment failed |
archived | Soft-deleted |
Deleting an Ambassador
waymaker host ambassadors delete <ambassador-id>
This archives the ambassador and removes the serverless function. Only the creator can delete.
Environment Variables
Ambassadors have their own environment variables, separate from apps. See Environment Variables for details.