Executing a workflow via a link
Getting a link for workflow execution
Note
You can get a link for workflow execution using the management console only if the workflow is public.
- In the management console
, select the folder containing the workflow. - Go to Serverless Integrations.
- In the left-hand panel, click
Workflows. - Select a workflow. The execution link will appear in the Start URL field.
To get an execution link, run this command:
yc serverless workflow get <container_name>
The execution link will appear in the execution_url field.
To get a workflow execution link, use the get REST API method for the Workflow resource or the WorkflowsService/Get gRPC API call. The execution link will appear in the execution_url field.
Executing a workflow via HTTPS
If the workflow is:
-
Public, any user can run it.
-
Private, the user needs to authenticate by providing the IAM token in the
Authorizationheader in the following format:Authorization: Bearer <IAM_token>
To execute a workflow, send a POST request:
-
Example of public workflow execution without providing the input data:
curl -X POST "https://serverless-workflows.api.cloud.yandex.net/workflows/v1/execution/fd2g4pu20roc********/start" -
Example of private workflow execution without providing the input data:
IAM_TOKEN="<IAM_token>" curl -X POST \ --header "Authorization: Bearer $IAM_TOKEN" \ "https://serverless-workflows.api.cloud.yandex.net/workflows/v1/execution/dfq3l36kr2gh********/start" -
Example of public workflow execution with providing input data (the input data is passed to the workflow input unchanged):
curl "https://serverless-workflows.api.cloud.yandex.net/workflows/v1/execution/fd2g4pu20roc********/start" -d '{"hello": "world"}'