Skip to navigation

Your First Script

View as MarkdownOpen in Claude

This guide picks up once Remediation Orchestrator is deployed, either with Helm or by following the non-Helm deployment checklist: a running deployment with an empty workflow list. It covers what a script is, how to write one, and how to get it running.

A base Remediation Orchestrator deployment serves and runs scripts on its own — the Temporal worker runs in-process, so no separate worker deployment is needed.

Prerequisites

  • A running Remediation Orchestrator UI open in your browser.
  • On an authenticated deployment, sign in as a tenant maintainer, or an identity with equivalent script, workflow and workflow-run access (Authorization). The local Helm stack and the quickstart (bazelisk run //examples/quickstart) need no login.

Scripts are uploaded through the UI or API, not mounted from disk. There is no filesystem drop folder.

1. Write your first script

A Remediation Orchestrator script is a Starlark file with one or more functions, each with a required docstring, and a register_workflow call at the top level to expose it as a workflow.

def greet(name):
"""Greet someone by name.
Args:
name: string, the name to greet
Returns:
string: the greeting
"""
return "Hello, " + name + "!"
register_workflow(greet)

The docstring is how Remediation Orchestrator maps incoming fields to function parameters and validates the return value. It is required for any function that takes arguments or returns a value.

2. Register the script

  1. Go to Automation > Scripts and select New Script.
  2. Enter greet.star as the Script name, paste the sample into Script contents and select Register.

A script name must end in .star and contain exactly one period.

Pass condition: greet.star appears in the scripts list.

3. Run it

  1. Go to Automation > Workflow Management, find the greet row and select Run Workflow.
  2. Enter world in the name field, leave the optional execution-context fields empty or at their defaults, and select Run.

Starting a workflow only submits it; the run continues asynchronously. Select View workflow timeline, or open Automation > Workflow Runs, to follow it.

Pass condition: the run shows a completed status.

Alternative: curl on an unauthenticated local deployment

This applies only to an isolated local deployment that has no login, such as the local Helm stack or the quickstart. Authenticated deployments use the signed-in UI or their deployment’s configured API access method; do not disable authentication to follow these commands.

Save the sample as greet.star. For the local Helm stack, keep its port-forward running. Set the URL, adjusting the port if yours differs:

MAESTRO_URL=http://localhost:6787
curl -X POST "$MAESTRO_URL/api/v1/script/greet.star" --data-binary @greet.star
curl -X POST "$MAESTRO_URL/api/v1/script/greet.star/greet" \
-H "Content-Type: application/json" \
-d '{"name": "world"}'

The second request returns a workflow ID once the run is submitted, not when it completes. Follow it in the UI or by polling, as described in Getting results back.


From here, see Writing Scripts for modules, triggers, node inventory, and additional script patterns.