Waymaker Host

Ambassadors (Serverless Functions)

Learn about Ambassadors (Serverless Functions) in WaymakerOS.

WorkersServerlessCron

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

QuestionOne AIEdge AI
Does it need premium reasoning?YesNo
Is it processing regulated data (HIPAA)?YesNot supported
Is speed more important than depth?NoYes
Will it run at high volume?Cost adds upBuilt for volume
Do I need structured JSON output?Use prompt engineeringBuilt-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_moderequired (default), public, or api-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:

  1. Checks out your repo
  2. Builds the serverless function
  3. Deploys to the global edge network (330+ cities)
  4. 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

ModeBehavior
requiredRequests must include a valid Waymaker auth token
optionalAuth token is checked if present, but anonymous requests are allowed
noneNo 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:

ScheduleMeaning
* * * * *Every minute
0 * * * *Every hour
0 */6 * * *Every 6 hours
0 9 * * 1Every Monday at 9am UTC
0 0 1 * *First day of every month

Ambassador Lifecycle

StatusMeaning
pendingCreated, not yet deployed
buildingBuild in progress
activeDeployed and running
errorLast deployment failed
archivedSoft-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.