Skip to main content
Product10 min read

604 - Running it: by hand, from the portal, and on a schedule

Four triggers, one run. By hand from any session with a single call or from the Run button on the script’s page, on a cadence set in the portal’s builder or by the agent with the fire date pinned onto the run, once for each event a source stores, or once per request to an endpoint. What happens when two runs of one script overlap: allowed, refused, or queued. What a schedule guarantees: one fire is one run, an overlapping fire is recorded as skipped, a gap produces one run for the latest fire, a failed scheduled run emails its owner with its cause and is never re-run on its own. And the run history that records every trigger, duration, output, result, and log.

What you will take away from this lesson

A saved script runs. There is no approval step and no state in which a script exists but nothing may execute it: the version you saved is the version that runs, whichever of four triggers asks for it. This lesson covers the four, what each one records, what happens when two runs of one script overlap, and the guarantees a schedule makes about the runs it produces.

The runs in the two previous lessons were all asked for from a session. Here the same script gets a Monday morning cadence on the demo tenant, and the answer the platform gave when it was set is the shape of everything a schedule promises.

Learning Objectives

  1. 01Name the four triggers: by hand from a session or the portal, on a schedule, once per event a source stores, and once per request to an endpoint.
  2. 02Run a script from any session with one call, follow a long run’s progress, stop it, and read its result later by its run id, or follow it as a task from a client that supports MCP Tasks.
  3. 03Choose how a script’s runs may overlap: allowed, refused, or queued.
  4. 04Run it from the script’s page, where Run and Dry run sit above the editor and one form built from the parameter contract serves both, and grant its runs to a persona, a role, or an API key.
  5. 05Set a cadence in the portal’s builder or with the agent, in a timezone, and read it back in words.
  6. 06Use ${fire_date} and explain why the script has no clock of its own.
  7. 07State what a schedule guarantees: one schedule per script, one fire is one run, an overlapping fire is recorded as skipped, a gap produces one run for the latest fire, a failed scheduled run emails its owner with its cause, and the platform never re-runs a failed run on its own.
  8. 08Read the Automations page with its Schedules and Runs tabs and a script’s run history, and know why a script’s schedule lives in Plexara while a prompt’s schedule lives in the agent.

Where this lesson sits

The series script writes the outputs from 603. This lesson is about what makes it run: the triggers, the cadence that turns a script into an automation, and the record every run leaves. The next lesson covers the authority each of those runs carries.

600 Series: Automations

Open index

The 600 series picks up the registered table from the 500 series and the prompt mechanics from the 400 series.

Four triggers, one run

A run is asked for on demand from a session or the Run button, on a schedule, once per event a source stores, or once per request to an endpoint an administrator binds it to, and the run itself does not care which. The platform executes the latest saved version, as the script’s own principal, and records which trigger asked.

Four triggers, one run

  • By hand, from a session or the portal

    trigger: tooltrigger: portal

    The owner, an administrator, or anyone the owner granted runs to

    From a session you ask for it in plain language and the agent calls run_script with the script’s name and its parameters; the values are checked against the contract before anything is queued, and the call waits for the result. From the script’s page you press Run, and the form is built from the parameter contract, so a date gets a date picker, an enum gets a choice, a list of choices gets checkboxes, a date range gets two dates, and a connection gets the set the script may reach.

  • On a schedule

    trigger: schedule

    Nobody; the cadence fires it

    A cadence, a timezone, and the values every fire binds. When it is due, Plexara runs the latest saved version with those values, whether or not anyone is connected.

  • Once per event

    trigger: event

    Nobody; each event the named source stores fires it

    The script names one source: a webhook, a form, or a mailbox. Each event the source stores queues one run, seconds after it is stored, and the run reads the event it was made for. A delivery the sender retries never makes a second run.

  • Once per request

    one audit row per request

    Another system, or a person’s browser, calling the script’s address

    An administrator binds the script to an endpoint, its own address on your deployment. Each request runs the script with the request in hand and returns its answer to the caller, a lookup or a feed another system calls. Each request is one audit row.

The four execute identically. Every run executes the latest saved version as the script’s own principal, presenting the roles its author held at the save, and the only difference in the record is the label saying which trigger asked. A script taken out of service, disabled, deprecated, or superseded, is refused by every trigger in the same words.

An owner can grant a script’s runs to a persona, a role, or an API key from the Access card on its page. A grant decides who may ask for a run, never what the run may reach. Where events come from and how a source keeps them is 607, and an automation that answers each event is 609.

Running one from a session

The common case is a person who wants the output now. You say so to the agent, the agent calls the script by name with the values it needs, and the answer comes back with the run’s record: the version that ran, how long it took, the outputs it wrote, and the log. The trace below is the first real run of the series script, acme-supplier-margin.

One run from a session, with the real answer

What the agent calls. This is the exchange the agent has with Plexara on your behalf, shown for the technical reader. You ask in plain language; you never type any of it.

run_script
  name   acme-supplier-margin
  args   {"month": "2025-12-01", "conn": "acme"}
  wait_seconds  120

-> status       succeeded
   trigger      tool
   version      3
   duration_ms  8542
   run_id       dpx_88dfb063…
   outputs      supplier-margin-by-category  asset 871da875…  version 1  (csv, 50 rows, 3,404 bytes)
                supplier-margin-feed         asset 589855b4…  version 1  (json, 1 row, 27,660 bytes)
   log          supplier margin review for 2025-12-01 to 2026-01-01
                categories quoted: 50, weighted cost change 2.57%
                largest increase: Flowers & Plants 14.800%
                at-risk SKUs under 20% projected margin: 25
                coverage: 400 of 450 quoted

The call waits up to two minutes by default and at most five. A run that outlives its window keeps going: the answer carries the run id with a pending status, and the agent reads the result when it finishes with manage_script get_run. Asking for a run that should not wait at all queues it and returns at once. Either way the run executes on Plexara, so a long report does not hold the agent’s session open and a run in progress survives a platform upgrade.

An agent whose client supports MCP Tasks is answered at once with a task instead of waiting. The task is the run: its id is the run id, its status message is the run’s latest progress line, cancelling the task cancels the run, and when the run ends the task carries the same answer, a failed run included.

Running one from the script’s page

The owner of a script runs it from the script’s own page, without an agent in the loop. Everything the run needs is already on that page: the saved code, a form built from the parameter contract, and the history the run will appear in.

Running from the script’s page

  1. 1

    Run and Dry run sit above the editor

    Run executes the saved version. Dry run executes what is on screen, as you, with tighter limits and nothing persisted. Both are on the page the owner already reads the script on.

  2. 2

    One form serves both

    The parameter form below the editor is built from the script’s contract: a date picker for a date, a choice for an enum, the set of reachable connections for a connection parameter. It supplies the values for a run and for a dry run alike.

  3. 3

    The history re-reads itself

    The run appears in the history under the code and updates as it progresses, with the script’s latest progress report and the log printed so far. A queued run can be canceled and a running one stopped, keeping what it already wrote. A value the script handed back shows as its Result.

A run asked for here and a run asked for by the agent are the same run in every respect except the trigger label. The page cannot widen anything: the run is authorized at every call against the roles captured at the script’s last save. And it cannot run what the platform would refuse, so a disabled or retired script says so instead of offering a button that cannot work.

An automation’s page in the portal: its details with owner, schedule in words, next run, and parameters, a What changed card with the agreed summary of the running version, the folded schedule with a Pause control, and the About section.
A script’s own page, ordered the way a script is debugged: details and schedule, the About document, the code with Run and Dry run above it and one parameter form below, then the run history.

The cadence

A schedule is what turns a script into an automation: a cadence, a timezone, and the parameter values every fire binds. It is set on the script’s page, in a builder that asks for the cadence the way a person has it in mind, or by the agent in one sentence. Both produce the same row, and the Automations page states it in words either way.

Setting a cadence: the builder, or a sentence to the agent

  • Hourly, daily, on weekdays, on chosen days of the week, or on a day of the month
  • A time, and the timezone the time is read in
  • The values every fire binds, checked against the parameter contract when the schedule is saved
  • A Custom field for an expression the builder cannot express; an expression the agent wrote opens there as itself

What the agent calls. This is the exchange the agent has with Plexara on your behalf, shown for the technical reader. You ask in plain language; you never type any of it.

manage_script command=schedule_set
  name      acme-supplier-margin
  cron      0 7 * * 1
  timezone  America/Los_Angeles
  args      {"month": "2025-12-01", "conn": "acme", "mode": "refresh"}

-> enabled       true
   cron          0 7 * * 1
   timezone      America/Los_Angeles
   next_run_at   2026-08-31T14:00:00Z
   missed_fires  0
   message       "The platform will run the latest saved version on this cadence,
                  with these parameters, as the script's own principal presenting
                  your captured roles."

The portal asks for a cadence in the terms a person has it in and derives the expression, showing it rather than asking for it; the Automations page then states it in words, as “Every Monday at 7:00 AM, America/Los_Angeles”. The agent sets the same thing with a cron expression or a descriptor such as @daily, and the answer above is what came back on the demo tenant. A cadence is read in its timezone, so a report stays on its wall clock across a daylight-saving change. A script has at most one schedule; setting it again replaces the cadence in place. Pausing and resuming are their own actions, and a schedule is never deleted, only disabled, so the runs it produced keep the row that explains them.

The date of the fire

A scheduled report almost always needs to know what day it is. The dialect deliberately gives a script no way to ask, and the schedule supplies the answer instead.

Pausing and resuming

A schedule is paused and resumed from the header of the Schedule section on the script’s page, or by the agent. Pausing is its own action rather than a field of the cadence, so resuming does not re-base the fire it resumes on, and nothing is ever deleted.

The Schedule section of an automation’s page with its schedule paused: a custom every-30-minutes schedule firing nothing until resumed, no next run in the details, a note that two fires were missed, and a Resume control.
A paused schedule. The cadence is kept and stated in words, no next run is shown because nothing will fire, and resuming picks up on the fire it was parked on. Disabling never removes the row, so the runs it produced keep their explanation.

When two runs of one script overlap

A schedule never overlaps itself, but a run started by hand, an event run, and a scheduled fire can all ask for the same script at once. Each script carries one setting that decides what happens then.

Overlapping runs: the three settings

SettingForWhat happens when a run is already open
AllowedThe defaultRuns of one script may overlap: a run started by hand beside a scheduled one, or two by hand. A schedule still never overlaps itself. When two runs save state, the later one fails at its save after its side effects have happened, and the next run repeats its work.
RefusedA script that sends data somewhere or moves a cursorWhile a run is open, a scheduled fire is recorded as skipped and a run asked for by hand is refused before anything is queued, naming the open run, what started it, and since when. Runs started by events wait their turn instead of being refused.
QueuedAn upstream that takes one request at a timeA second run is accepted and waits until no other run of the script is running, then runs. Runs are taken in the order they were started, and event runs in the order their events arrived.

The setting is shown above the run history on the script’s page as Overlapping runs, and the agent sets it in the same words. The database holds a refused script to one open run and a queued script to one running run, so two servers starting a run at the same instant cannot both succeed.

What a schedule guarantees

Eight rules govern the runs a schedule produces. They are what let you trust a number that arrived on a Monday morning nobody was watching.

What a schedule guarantees

  1. 01

    One schedule per script

    Setting it again replaces the cadence in place and keeps the run history that points at it. A second cadence over the same code is a second script.

  2. 02

    One fire is one run

    A fire produces exactly one run, however the platform is scaled underneath. Nothing about a fire is duplicated.

  3. 03

    An overlapping fire is recorded as skipped

    A fire arriving while the previous run is still going does not queue behind it. It is recorded as a skipped run, so the skip appears in the history rather than as silence.

  4. 04

    One run at a time, when it is set

    Runs started by hand have no schedule and may overlap one another or a scheduled run. A script whose runs send data somewhere or move a cursor is set to run one at a time: while a run is open, Run is refused naming that run and a fire is recorded as skipped.

  5. 05

    After a gap, one run for the latest fire

    When fires could not be materialized for a while, one run is produced for the most recent fire that has come due, and the fires before it are counted as missed on the schedule. A catch-up burst of stale reports would be worse than a visible gap; a backfill somebody wants is a run by hand with the parameters they want.

  6. 06

    A paused schedule resumes on the fire it was parked on

    While it is paused it reports no next run. The fire it resumes on collapses to one run under the same rule as a gap.

  7. 07

    A failed scheduled run emails its owner

    The mail carries the run id, the failure, the tail of what the script printed, and whether the next run is expected to pass. When three or more runs in a row have failed on the same error, it says the script needs correcting. The owner’s agent is also told about failing automations at the start of the next session. A run asked for by hand is not mailed, because its failure is already in the answer its caller is reading.

  8. 08

    A failure is classified, and never re-run on its own

    Every failed run carries its cause: the script, a service it called, memory, or the platform. A service that was briefly unavailable is recorded as that service’s failure, not the script’s, and the next fire is expected to pass. A temporary warehouse read failure is tried again inside the run, a few times, before it counts. The platform never re-executes a failed run, because a run that already wrote must not be repeated on a guess. A run that could not start because of a platform fault is put back on the queue.

The record a run leaves

Every run, whichever trigger asked for it, records the same things, and the portal shows them at three levels: the Automations page for the state of everything, its Runs tab for every run newest first, and a run’s own page for one run in full.

What one run records

Trigger
tool, portal, or schedule: which of the three asked for the run, and who requested it.
Version
The saved version that executed, which is the version that was latest when the run was queued.
Duration and outcome
When it started, how long it took, and whether it succeeded, failed, was canceled, or was skipped as an overlap. A failure carries the error, the line it failed on, its cause, and whether running it again is expected to help.
Progress and result
A running run shows the script’s latest progress report. A value the script handed back is kept on the run as its result.
Outputs
Each output by name, linking to the asset version it produced. An output delivered to a drop names where it was written instead.
The log
What the script printed, kept to 64 KB with the head preserved.

A year of run history is kept. A script’s page shows its most recent runs with a rollup in the header: the share that succeeded, how many failed, were skipped, or were canceled, and the median duration. The Automations page has three tabs: the automations, a Schedules tab that draws when every scheduled script fires, and a Runs tab with every run newest first and the reason a run failed in the row rather than behind it. Anyone signed in sees how each run went; what a run was given, printed, and wrote stays with the owner, administrators, and whoever requested that run. The agent reads the same records with manage_script command=runs and get_run.

The portal’s Automations page: Automations, Schedules, and Runs tabs, a search box with author, category, tag, and status filters, a count of automations, scheduled ones, and last-run failures, and a table of automations each showing its schedule in words, its next fire, and how its last run ended.
The Automations page, captured when the section was still named Scripts. Three tiles that are also filters: every script, the ones with a schedule (paused or not), and the ones whose last run failed, which is the number most people open this page for. Each row states its cadence in words and how its last run went.
The Runs tab: every run of every script the person owns, newest first, with the trigger, the outcome, the duration, and for a failed run the reason in the row.
The Runs tab: every run across your scripts, newest first, with what triggered it, how it ended, how long it took, and, when it failed, the reason in the row. Opening a row opens the run on its script’s page.
A single run’s page: the parameters it ran with, its timing, each output linking to the asset version it produced, and the log the script printed.
One run, at its own address: parameters, timing, outputs linking to the versions they wrote, and the log.

Why a prompt’s schedule lives in the agent and a script’s lives in Plexara

Lesson 404 said that scheduling a prompt is not a Plexara feature at all. This lesson has just described Plexara scheduling a script. Both statements are true, and the difference between them is the difference between the two kinds of saved work.

Scheduling a prompt, scheduling a script

A prompt (404)A script (this lesson)
Who keeps the clock
Your agent: an in-session loop, headless plus cron, a desktop task, a cloud routine.
Plexara. The cadence is a row on the script, fired by the platform.
What a fire needs
A model. A fresh session starts, connects to Plexara, and runs the prompt by name.
Nothing. No model, no session, no tokens; the platform executes the saved version.
What varies between fires
The model’s reading of the instruction, which is the point of a prompt.
Only the data. The script contributes no variation of its own.
Where the record lives
In the asset the prompt saved, and the agent’s own session log.
On the run: trigger, version, duration, outputs, log, kept for a year.

Lesson 404 explained why a prompt’s schedule lives in the agent: a prompt is an instruction, and running one needs a model to read it. A script needs none, which is why its schedule lives in Plexara and why the 606 capstone puts the two together: a schedule keeps the scripts’ outputs fresh, and a prompt tells the agent what to make of them.

From a run to its authority

Four triggers, one schedule, one record. The script on the demo tenant now fires every Monday at seven, refreshes its dashboard, and writes a run record nobody has to be awake for.

Key terms

Five terms cover how a script comes to run and what it leaves behind.

Key Terms

Trigger
Which of the three producers asked for a run: tool for run_script from a session, portal for the Run button on the script’s page, schedule for a fire. Recorded on the run; the three execute identically.
Cadenceschedule
A cron expression or a descriptor, a timezone, and the values every fire binds. One per script; set in the portal’s builder or by the agent; paused and resumed rather than deleted.
Fire
The moment a cadence comes due. One fire is one run. A fire arriving while the previous run is still going, or while any run of a one-at-a-time script is open, is recorded as skipped; after a gap, one run is produced for the latest fire.
${fire_date}
The one token a schedule’s bound values may carry. It expands to the date of the fire in the schedule’s timezone and is recorded on the run, which is why the script needs no clock.
Run record
Trigger, version, duration, outcome and its cause, outputs linking to the asset versions they wrote, any result, and the log. Read on the script’s page, on the Runs tab, and by the agent; kept for a year.