GetHistory
Retrieves detailed history of specified Workflow execution.
- TypeScript
- Python
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);
})();
import os
import grpc
import yandexcloud
from yandex.cloud.serverless.workflows.v1.execution_service_pb2_grpc import ExecutionServiceStub
from yandex.cloud.serverless.workflows.v1.execution_service_pb2 import GetExecutionHistoryRequest
token = os.getenv("YC_OAUTH_TOKEN")
sdk = yandexcloud.SDK(token=token)
service = sdk.client(ExecutionServiceStub)
response = service.GetHistory(GetExecutionHistoryRequest(execution_id="executionId"))
print(response)
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_UNSPECIFIEDSCHEDULEDStep execution is being scheduled.
STARTEDStep execution is started.
COMPLETEDStep execution is completed.
FAILEDStep execution is failed.
CANCEL_REQUESTEDStep execution is requested to be cancelled.
CANCELLEDStep 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: stringJSON input data for the Workflow step.
HistoryEntryOutput
One of output
outputJson: stringJSON result for the Workflow step.