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.

AutomationRunListParams Fields

FieldDescription
UserId
int64
User ID. Provide a value of 0 to operate the current session's user.
AutomationId
int64
Required
ID of the associated Automation.

Additional Arguments

Example Request

import (
    "fmt"
    "errors"

    files_sdk "github.com/Files-com/files-sdk-go/v3"
    automation_run "github.com/Files-com/files-sdk-go/v3/automationrun"
)

automationRunIterator, err := automation_run.List(files_sdk.AutomationRunListParams{AutomationId: 1})
if err != nil {
    var respErr files_sdk.ResponseError
    if errors.As(err, &respErr) {
        fmt.Println("Response Error Occurred (" + respErr.Type + "): " + respErr.ErrorMessage)
    } else {
        fmt.Printf("Unexpected Error: %s\n", err.Error())
    }
}

for automationRunIterator.Next() {
    automationRun := automationRunIterator.automationRun()
}
err = automationRunIterator.Err()
if err != nil {
    var respErr files_sdk.ResponseError
    if errors.As(err, &respErr) {
        fmt.Println("Response Error Occurred (" + respErr.Type + "): " + respErr.ErrorMessage)
    } else {
        fmt.Printf("Unexpected Error: %s\n", err.Error())
    }
}

Show Automation Run

SDK Method

automationrun.Find()

Return Object

AutomationRun

Authorization Requirement

Available to all authenticated keys or sessions.

AutomationRunFindParams Fields

FieldDescription
Id
int64
Required
Automation Run ID.

Example Request

import (
    "fmt"
    "errors"

    files_sdk "github.com/Files-com/files-sdk-go/v3"
    automation_run "github.com/Files-com/files-sdk-go/v3/automationrun"
)

automationRun, err := automation_run.Find(files_sdk.AutomationRunFindParams{Id: 1})
if err != nil {
    var respErr files_sdk.ResponseError
    if errors.As(err, &respErr) {
        fmt.Println("Response Error Occurred (" + respErr.Type + "): " + respErr.ErrorMessage)
    } else {
        fmt.Printf("Unexpected Error: %s\n", err.Error())
    }
}

Cancel Automation Run

SDK Method

automationrun.Cancel()

Return Object

AutomationRun

Authorization Requirement

Available to all authenticated keys or sessions.

AutomationRunCancelParams Fields

FieldDescription
Id
int64
Required
Automation Run ID.

Example Request

import (
    "fmt"
    "errors"

    files_sdk "github.com/Files-com/files-sdk-go/v3"
    automation_run "github.com/Files-com/files-sdk-go/v3/automationrun"
)

automationRun, err := automation_run.Cancel(files_sdk.AutomationRunCancelParams{Id: 1})
if err != nil {
    var respErr files_sdk.ResponseError
    if errors.As(err, &respErr) {
        fmt.Println("Response Error Occurred (" + respErr.Type + "): " + respErr.ErrorMessage)
    } else {
        fmt.Printf("Unexpected Error: %s\n", err.Error())
    }
}

Re-run Automation from Node

SDK Method

automationrun.Rerun()

Return Object

AutomationRun

Authorization Requirement

Available to all authenticated keys or sessions.

AutomationRunRerunParams Fields

FieldDescription
Id
int64
Required
Automation Run ID.
NodeId
string
Required
Node ID at which execution should resume.

Example Request

import (
    "fmt"
    "errors"

    files_sdk "github.com/Files-com/files-sdk-go/v3"
    automation_run "github.com/Files-com/files-sdk-go/v3/automationrun"
)

automationRun, err := automation_run.Rerun(files_sdk.AutomationRunRerunParams{
  Id: 1,
  NodeId: "node_id"
})
if err != nil {
    var respErr files_sdk.ResponseError
    if errors.As(err, &respErr) {
        fmt.Println("Response Error Occurred (" + respErr.Type + "): " + respErr.ErrorMessage)
    } else {
        fmt.Printf("Unexpected Error: %s\n", err.Error())
    }
}

The AutomationRun Object

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

AttributeDescription
Id
int64
ID.
AutomationId
int64
ID of the associated Automation.
AutomationVersionId
int64
ID of the immutable Automation version pinned by this run.
Version
int64
Pinned Automation v2 definition version.
WorkspaceId
int64
Workspace ID.
CancelRequestedAt
date-time
Date/time at which cancellation was requested.
CompletedAt
date-time
Automation run completion/failure date/time.
CreatedAt
date-time
Automation run start date/time.
RetryAt
date-time
If set, this automation will be retried at this date/time due to failure or partial_failure.
RetriedAt
date-time
If set, this Automation run was retried due to failure or partial_failure.
RetriedInRunId
int64
ID of the run that is or will be retrying this run.
RetryOfRunId
int64
ID of the original run that this run is retrying.
RerunOfRunId
int64
ID of the run whose persisted node outputs this run reused.
RerunFromNodeId
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
SuccessfulOperations
int64
Count of successful operations.
FailedOperations
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.
NodeStates
object
Status and execution stage for each node in this run. For performance reasons, this is not provided when listing Automation runs.
ExecutionNodes
array(object)
Execution status, timing, and bounded output summaries for each node. For performance reasons, this is not provided when listing Automation runs.
JournalUrl
string
Link to the run journal artifact.
StatusMessagesUrl
string
Link to status messages log file.