Skip to main content

GetHistory

Retrieves detailed history of specified Workflow execution.

import { cloudApi, serviceClients, Session } from "@yandex-cloud/nodejs-sdk";

const GetExecutionHistoryRequest =
cloudApi.serverless.workflows_execution_service.GetExecutionHistoryRequest;

(async () => {
const authToken = process.env["YC_OAUTH_TOKEN"];
const session = new Session({ oauthToken: authToken });
const client = session.client(serviceClients.ExecutionServiceClient);

const result = await client.getHistory(
GetExecutionHistoryRequest.fromPartial({
executionId: "executionId",
})
);
console.log(result);
})();

GetExecutionHistoryRequest​

executionId : string​

ID of the Workflow execution.

GetExecutionHistoryResponse​

execution : ExecutionPreview​

Workflow execution details.

entries : HistoryEntry​

Workflow execution detailed history items.

ExecutionPreview​

id : string​

ID of the Workflow execution. Generated at creation time.

workflowId : string​

ID of the Workflow.

status : Execution.Status​

Status of the Workflow execution

startedAt : google.protobuf.Timestamp​

Start timestamp for the Workflow execution.

duration : google.protobuf.Duration​

Duration of the Workflow execution.

HistoryEntry​

Status​
  • STATUS_UNSPECIFIED

  • SCHEDULED

    Step execution is being scheduled.

  • STARTED

    Step execution is started.

  • COMPLETED

    Step execution is completed.

  • FAILED

    Step execution is failed.

  • CANCEL_REQUESTED

    Step execution is requested to be cancelled.

  • CANCELLED

    Step execution is canceled.

FailedAttempt​
startedAt : google.protobuf.Timestamp​

Start timestamp for the attempt.

duration : google.protobuf.Duration​

Duration of the attempt.

error : HistoryEntryError​

Error details.

id : string​

ID of the Workflow step.

title : string​

Title of the Workflow step.

description : string​

Description of the Workflow step.

startedAt : google.protobuf.Timestamp​

Start timestamp for the Workflow step.

duration : google.protobuf.Duration​

Duration of the Workflow step.

input : HistoryEntryInput​

Input data for the Workflow step.

output : HistoryEntryOutput​

Result of the Workflow step.

error : HistoryEntryError​

Error details, in case Workflow step failed.

status : Status​

Status of the Workflow step.

type : string​

Type of the Workflow step (for example, FunctionCall or HttpCall).

attempts : int64​

Number of attempts (including all retries of unsuccessful attempts). Value "1" means there were no retries.

lastError : HistoryEntryError​

Last received error details in case of retries.

HistoryEntryError​

message : string​

Error message of the Workflow step.

errorCode : string​

Error code of the Workflow step.

HistoryEntryInput​

One of input​

  • inputJson : string​

    JSON input data for the Workflow step.

HistoryEntryOutput​

One of output​

  • outputJson : string​

    JSON result for the Workflow step.