← Integration Academy

Production Pulse · 4 / 8

Add an on-demand status action

Give a person or workflow a named way to request a status result.

YOUR TASK

Make this happen

3 steps
  1. Name the Action status and give it the label Check production pulse.

  2. Use a required boolean alive output field.

  3. Add integration_actor_action.status to actions in actor.cococo.

This lesson starts with the previous working solution. Build and connect the next capability. Your earlier drafts are kept separately.

Read the starter files

main.cococo

integration_document "monitor" {
  integrationId = "com.academy.monitor"
  sdkVersion = "2.0"
  version = "1.0.0"
  description = "A small heartbeat integration"
  actor = integration_actor.monitor
}

actor.cococo

integration_actor "monitor" {
  subscriptions = [integration_actor_subscription.job_updates]
  timers = [integration_actor_timer.heartbeat, integration_actor_timer.daily_review]
}

timer.cococo

integration_actor_timer "heartbeat" {
  name = "heartbeat"
  schedule = { every = "5m" }
  jitter = "15s"
  source = "return { alive = true }"
}

events.cococo

integration_actor_subscription "job_updates" {
  topic = "job.updated"
  source = file("scripts/job-updated.lua")
}

daily.cococo

integration_actor_timer "daily_review" {
  name = "daily_review"
  schedule = { cron = "0 6 * * *" }
  source = "return { review = true }"
}

actions.cococo

integration_actor_action "status" {
  name = "status"
  label = "Check production pulse"
  # TODO: add inputSchema — see the task above.
  # TODO: add outputSchema — see the task above.
  # TODO: add source — see the task above.
}
Supplied scripts and pinned contracts (read-only)

These fixtures explain the runtime behaviour being composed. They are included in validation but are not executed. The generated API definition is supplied, not an XML authoring task.

scripts/heartbeat.lua

return { alive = true }

scripts/job-updated.lua

local event, config = ...
return { reason = "job.updated" }

scripts/status.lua

local input, actionConfig = ...
return { alive = true }