Executions and Monitoring

Updated Nov 9, 2026
DataMagik Automate

What is recorded

Every time a script or workflow runs, DataMagik records the run: what started it, how it ended, what it logged, what it returned and what it was given. This page covers where to find those runs, how to read one, and how to hear about failures.

The Executions screen

Open Script Engine › Executions. It lists every run in your company, newest first, 50 to a page, from every source: the editor, schedules, API calls, inbound email, file drops, apps, automations and workflows. You need the DataMagik - Builder or DataMagik - Viewer permission.

Each run is one card showing:

  • its status;
  • reported failure if the script finished but returned success: false (see What counts as a failure);
  • when it started, and the script's name and ID;
  • how long it took, and how many console lines it wrote;
  • what started it, and the API key's name when it was started with one.

A run that did not complete shows its error message on the card. A run whose script has since been deleted shows (deleted script).

Statuses

StatusMeaning
queuedWaiting for a worker to pick it up.
processingRunning now.
completedThe script finished and returned.
failedThe script threw an error, or the run could not be completed (for example, its worker stopped).
timeoutThe script ran past its timeout and was stopped.
cancelledThe run was cancelled while it was still waiting, for example with Cancel on the Schedules screen. A run that has already started is not cancelled.

Filters

FilterWhat it does
ScriptOne script. Type part of a name or an ID. Deleted scripts can be chosen too, since their runs are still here.
IntegrationsOnly the scripts in one Integration.
OutcomeSuccess, Failure or Running (queued or processing).
Started byWhat started the run. See the table below.
From / ToA date range, in your own time zone. With no dates, the screen shows the last 7 days.

Click Apply to filter, Reset to clear, and Prev / Next to page. The page address keeps the filters, so you can bookmark a view or send it to someone.

Started byRuns started by
API key (webhook)Another system calling the script with an API key. See Script Webhooks.
A person (Run)Someone pressing Run, signed in, without an API key. Reruns are listed here too.
ScheduleA schedule, on time or with Run. See Script Schedules.
AppA published app.
AutomationAn automation's Script action.
File dropA file arriving on a file endpoint.
Inbound emailA message reaching an inbound address. See Inbound Email.

Runs from other places show their own label on the card, for example test-run for a test run from the editor, dashboard, assistant for an AI assistant's tool call, and workflow_failure for a When a Workflow Fails alert.

Opening a run

Click a card to open it. The tabs are:

TabShows
ConsoleEverything the script logged with console.log and its siblings. A long log shows its first lines; Show all shows every line.
OutputThe script's return value.
ErrorThe error message and stack trace. Only when there was an error; a failed run opens on this tab.
DocsDocuments the run generated, with Download. Only when there are some.
InputWhat the run was given: the API body, the email, the file, or the app's parameters.

Below the tabs: memory used, run time, the number of API calls the script made, what triggered it (such as schedule_42 for schedule 42), the run's execution ID, and Open script. Stopped by a restart means the run was cut short when its worker was shut down. Users with the Admin Dashboard permission also see which worker ran it.

A link to /datamagik/script-executions?execution=<execution id> opens the screen with that run expanded. Failure alerts use these links.

Running it again

A failed run can be rerun with the same input from its Integration's live feed (Rerun, Builders only). The rerun is a new run of the script's current saved version, listed under A person (Run). Test runs cannot be rerun. For a schedule, use Run on the Schedules screen; for an email, use Replay in the hook's Received messages.

What counts as a failure

A run is a failure if its status is failed, timeout or cancelled, or if it completed but returned an object with success: false:

function main(context) {
  const orders = context.orders || [];
  if (orders.length === 0) {
    return { success: false, error: "The call had no orders in it" };
  }
  // ... process the orders ...
  return { success: true, count: orders.length };
}

Returning success: false is the way for a script to say "I ran, but the job did not get done" without throwing. Executions marks such a run reported failure, the Failure filter includes it, and Integrations counts it against the success rate. A run that is still queued or processing is neither a success nor a failure yet.

Throwing an error is different: the run's status becomes failed, and the error and stack trace are kept. Use a throw for a real fault and success: false for an expected "nothing to do" or "partner said no".

Integrations

An Integration groups the scripts and workflows that make up one job, such as "Plex to EDI 856 for Acme", and shows their runs, success rate, failures and schedules on one page, with a health status of Healthy, Degraded, Failing or Quiet. See Integrations.

Hearing about failures

To be told when something fails, build a workflow with a When a Workflow Fails trigger, choose what it watches (every workflow and script, every workflow, or the ones you name), and add a Send Email or Teams / Slack Message step. It starts for runs whose status is failed or timeout, usually within a minute. It does not start for test runs, for its own failures, or for a run that completed with success: false; if you need an alert for those, have the script throw instead. See Workflows in Production.

The alert's {{ $json.failed.link }} opens the failed run in Executions.

Other places to see runs

  • The Script Engine's history panel: the runs of the script you have open.
  • Schedules › History: a schedule's latest runs, with retry attempts.
  • Inbound Email › Received messages: each message and the run it started.
  • An Integration's page: its scripts' runs as they happen.

How long runs are kept

Run records, with their console output, return value and input, are kept for 90 days and then deleted. Save anything you need for longer, such as generated documents, somewhere permanent from the script itself.

Was this page helpful?