Automation Runs

An AutomationRun is a record with information about a single execution of a given Automation.

Automation Runs can be retried upon failure or partial_failure by setting the retry_on_failure_interval_in_minutes and retry_on_failure_number_of_attempts settings on the associated Automation.

When retries occur, a new AutomationRun will be created for each retry. The property retry_at on the original run, if set, represents when that run will be retried next. The properties retried_at and retried_in_run_id will be set in the original run that failed, at the time of retry. The property retry_of_run_id will be set in the new run.

List Automation Runs

SDK Method

AutomationRun.list()

Return Object

AutomationRun[]

Authorization Requirement

Available to all authenticated keys or sessions.

Method Arguments

ArgumentDescription
user_id
int64
User ID. Provide a value of 0 to operate the current session's user.
automation_id
int64
Required
ID of the associated Automation.

Additional Arguments

Example Request

import AutomationRun from 'files.com/lib/models/AutomationRun';
import * as FilesErrors from 'files.com/lib/Errors';

try {
  const automationRuns = await AutomationRun.list({
    automation_id: 1,
  });
  for (const automationRun of automationRuns) {
    // Operate on automationRun
  }
} catch (err) {
  if (err instanceof FilesErrors.NotAuthenticatedError) {
    console.error(`Authentication Error Occurred (${err.constructor.name}): ${err.error}`);
  } else if (err instanceof FilesErrors.FilesError) {
    console.error(`Unknown Error Occurred (${err.constructor.name}): ${err.error}`);
  } else {
    throw err;
  }
}

Show Automation Run

SDK Method

AutomationRun.find()

Return Object

AutomationRun

Authorization Requirement

Available to all authenticated keys or sessions.

Method Arguments

ArgumentDescription
id
int64
Required
Automation Run ID.

Example Request

import AutomationRun from 'files.com/lib/models/AutomationRun';
import * as FilesErrors from 'files.com/lib/Errors';

try {
  const automationRun = await AutomationRun.find(id);
  // Operate on automationRun
} catch (err) {
  if (err instanceof FilesErrors.NotAuthenticatedError) {
    console.error(`Authentication Error Occurred (${err.constructor.name}): ${err.error}`);
  } else if (err instanceof FilesErrors.FilesError) {
    console.error(`Unknown Error Occurred (${err.constructor.name}): ${err.error}`);
  } else {
    throw err;
  }
}

Cancel Automation Run

SDK Method

automationRun.cancel()

Return Object

AutomationRun

Authorization Requirement

Available to all authenticated keys or sessions.

Example Request

import AutomationRun from 'files.com/lib/models/AutomationRun';
import * as FilesErrors from 'files.com/lib/Errors';

try {
  // Find the automationRun object by its id.
  const automationRun = await AutomationRun.find(id);
  await automationRun.cancel();
} catch (err) {
  if (err instanceof FilesErrors.NotAuthenticatedError) {
    console.error(`Authentication Error Occurred (${err.constructor.name}): ${err.error}`);
  } else if (err instanceof FilesErrors.FilesError) {
    console.error(`Unknown Error Occurred (${err.constructor.name}): ${err.error}`);
  } else {
    throw err;
  }
}

Re-run Automation from Node

SDK Method

automationRun.rerun()

Return Object

AutomationRun

Authorization Requirement

Available to all authenticated keys or sessions.

Method Arguments

ArgumentDescription
node_id
string
Required
Node ID at which execution should resume.

Example Request

import AutomationRun from 'files.com/lib/models/AutomationRun';
import * as FilesErrors from 'files.com/lib/Errors';

try {
  // Find the automationRun object by its id.
  const automationRun = await AutomationRun.find(id);
  await automationRun.rerun({
    node_id: "node_id",
  });
} catch (err) {
  if (err instanceof FilesErrors.NotAuthenticatedError) {
    console.error(`Authentication Error Occurred (${err.constructor.name}): ${err.error}`);
  } else if (err instanceof FilesErrors.FilesError) {
    console.error(`Unknown Error Occurred (${err.constructor.name}): ${err.error}`);
  } else {
    throw err;
  }
}

The AutomationRun Object

Some of the methods above return a AutomationRun object. The attributes of this object are listed below.

AttributeDescription
id
int64
ID.
automation_id
int64
ID of the associated Automation.
automation_version_id
int64
ID of the immutable Automation version pinned by this run.
version
int64
Pinned Automation v2 definition version.
workspace_id
int64
Workspace ID.
cancel_requested_at
date-time
Date/time at which cancellation was requested.
completed_at
date-time
Automation run completion/failure date/time.
created_at
date-time
Automation run start date/time.
retry_at
date-time
If set, this automation will be retried at this date/time due to failure or partial_failure.
retried_at
date-time
If set, this Automation run was retried due to failure or partial_failure.
retried_in_run_id
int64
ID of the run that is or will be retrying this run.
retry_of_run_id
int64
ID of the original run that this run is retrying.
rerun_of_run_id
int64
ID of the run whose persisted node outputs this run reused.
rerun_from_node_id
string
Node at which this run resumed execution.
runtime
double
Automation run runtime.
status
string
The status of the AutomationRun. One of queued, running, success, partial_failure, failure, skipped, or canceled.
Possible values: running, success, partial_failure, failure, skipped, queued, canceled
successful_operations
int64
Count of successful operations.
failed_operations
int64
Count of failed operations.
definition
object
Automation definition snapshot pinned by this run. For performance reasons, this is not provided when listing Automation runs.
node_states
object
Status and execution stage for each node in this run. For performance reasons, this is not provided when listing Automation runs.
execution_nodes
array(object)
Execution status, timing, and bounded output summaries for each node. For performance reasons, this is not provided when listing Automation runs.
journal_url
string
Link to the run journal artifact.
status_messages_url
string
Link to status messages log file.