Start
Starts new Workflow execution.
- TypeScript
- Python
import { cloudApi, serviceClients, Session } from "@yandex-cloud/nodejs-sdk";
const StartExecutionRequest =
cloudApi.serverless.workflows_execution_service.StartExecutionRequest;
(async () => {
const authToken = process.env["YC_OAUTH_TOKEN"];
const session = new Session({ oauthToken: authToken });
const client = session.client(serviceClients.ExecutionServiceClient);
const result = await client.start(
StartExecutionRequest.fromPartial({
workflowId: "workflowId",
// input: {
// inputJson: "inputJson"
// }
})
);
console.log(result);
})();
import os
import grpc
import yandexcloud
from yandex.cloud.serverless.workflows.v1.execution_pb2 import ExecutionInput
from yandex.cloud.serverless.workflows.v1.execution_service_pb2_grpc import ExecutionServiceStub
from yandex.cloud.serverless.workflows.v1.execution_service_pb2 import StartExecutionRequest
token = os.getenv("YC_OAUTH_TOKEN")
sdk = yandexcloud.SDK(token=token)
service = sdk.client(ExecutionServiceStub)
response = service.Start(
StartExecutionRequest(
workflow_id="workflowId",
# input = ExecutionInput(
# input_json = "inputJson"
# )
)
)
print(response)
StartExecutionRequest
workflowId
: string
ID of the Workflow.
input
: ExecutionInput
Input for the Workflow execution
ExecutionInput
One of input
inputJson
: stringJSON input data for the Workflow execution.
StartExecutionResponse
executionId
: string
ID of the Workflow execution.