Ir al contenido
Developer Preview — APIs and language features may change before 1.0

Lesson 6: Going Live

Esta página aún no está disponible en tu idioma.

Your email triage machine works in Koda. You run it manually and it classifies, routes, and acts. But you are not going to type /run email_triage 150 times a day.

This lesson deploys your machine as a live endpoint and schedules it to run automatically.

Before you deploy, notice what deploying does not do. There is no build step that rewrites your machine, no framework that wraps it, no generated bundle that stands between the file in your editor and the endpoint that answers requests. Diff the email_triage file you have been editing against what the computer runs after you deploy it: nothing changed. They are the same file.

In most systems the code you prototype and the code that runs in production are two different artifacts, and the gap between them is where surprises live. Here there is no gap. The machine you tested in Koda is the machine that goes live, byte for byte. That is why “going live” is one command and not a project.

One command:

/deploy email_triage

This creates a live HTTP endpoint. Any system can call it:

POST https://your-org.mashin.live/api/email-triage/run
{
"subject": "URGENT: Client escalation",
"sender": "[email protected]",
"body": "We need to talk immediately."
}

The response comes back with the classification, routing decision, and what action was taken.

By default, the endpoint requires an API key. You can also make it public or protect it with SSO:

/deploy email_triage --auth public
/deploy email_triage --auth sso

To check email automatically every 5 minutes:

/schedule email_triage --cron "*/5 * * * *"

That is a cron expression. */5 * * * * means “every 5 minutes.” Some common schedules:

Schedule Cron Use case
Every 5 minutes */5 * * * * Email triage, monitoring
Every hour 0 * * * * Report generation
Daily at 9am 0 9 * * * Morning briefing
Weekdays at 6pm 0 18 * * 1-5 End-of-day summary

Once scheduled, the machine runs on its own. You do not need to be in Koda.

After deploying, you can see:

Recent runs:

ask Koda: show me the last 10 runs of email_triage

Cost over time:

/cost email_triage

This shows estimated daily, weekly, and monthly cost based on actual usage.

Failures: If a run fails (Teams is down, API error, unexpected input), mashin creates a signal. You will see it in Koda the next time you open it:

[!] email_triage failed 3 times in the last hour
Last error: Teams API returned 503
Affected: 3 emails routed to notify_team

Signals show up automatically. You do not need to check logs.

If something goes wrong:

ask Koda: pause the email_triage deployment

The endpoint stops accepting requests. No emails are processed. Fix the issue, then:

ask Koda: resume email_triage

Every deployed run records:

  • Input and output
  • Execution time per step
  • Token usage and cost
  • Which models were called
  • Which external systems were contacted
  • Success or failure with error details

This is not logging you added. It is the governance record that every machine produces automatically. When your manager asks “what did this thing do last Tuesday at 3pm?” you have the answer.

At 150 emails/day using Haiku for classification:

  • Classification: ~$0.05/day ($1.50/month)
  • Teams notifications: $0 (no AI cost)
  • Planner task creation: $0 (no AI cost)
  • Total: about $1.50/month

The execution trace breaks this down per run, per step, per model. No surprises.

Your machine is live and running automatically. But how do you know it is working correctly? What if the classification accuracy drifts? What if an edge case slips through?

Next lesson: adding goals and tests. A contract that defines success, with automated tests that catch problems before your users do.

Next: Goals and Tests →