Getting started with Workflows
Note
Workflows is at the Preview stage.
Note
Currently, there are two UIs that support Workflows: Yandex Cloud and Yandex AI Studio. In this case, the following applies:
- Workflows created in the Yandex Cloud UI are automatically available in the AI Studio UI.
- Workflows created in the AI Studio UI are not available in the Yandex Cloud UI.
Starting September 3, 2026, Workflows will no longer be supported in the Yandex Cloud UI. To create and manage workflows, use the AI Studio UI.
Using this tutorial, you will create and run a workflow. During the execution of the workflow, the Yandex Cloud Functions functions will be called.
Get your cloud ready
AI Studio follows the Yandex Cloud resource model, where most services store their resources in folders. Folders belong to clouds, and clouds belong to organizations. You will need a folder to work with AI Studio.
-
Log in to AI Studio under your personal Yandex account (Yandex ID). For a detailed guide on how to create such an account, see Yandex ID Help.
-
Create an organization:
- Enter the organization name.
- Specify the cloud name. This name will be used for all the Yandex Cloud resources.
- Click Open AI Studio.
The organization will automatically get a new folder named
default.
Linking a billing account
To work with AI Studio, you need an active billing account linked to your cloud. When you create your first billing account and add a credit/debit card, you will get your initial grant.
-
After you log in to AI Studio, click Link billing account in the top-right corner of the UI.
-
Create a billing account or select an existing one.
- Click Add card.
- Specify your card details: 16-digit number, expiration date, and CVV (you can find it on the back side of your card).
- Click Link.
-
Make sure the billing account status is
ACTIVEorTRIAL_ACTIVE.
Create a service account
- In the management console, select the folder for your service account.
- Navigate to Identity and Access Management.
- Click Create service account.
- Name the service account:
sa-for-function. - Click
Add role and selectfunctions.functionInvoker. - Click Create.
Create a function to filter data
- In the management console, select the folder to create your function in.
- Navigate to Cloud Functions.
- Create a function:
- In the top-right corner, click Create function.
- Enter the function name:
filter-function. - Click Create.
- Create a function version:
- In the Editor window that opens, select
Node.js 22. - Disable Add files with code examples.
- Click Continue.
- Create a file named
index.jsand add the following code into it:module.exports.handler = async function (data, context) { return { id: data.id, name: data.name, email: data.email, }; }; - Under Parameters, specify the following in the field:
- Entry point:
index.handler. - Service account:
sa-for-function.
- Entry point:
- Click Save changes.
- In the Editor window that opens, select
Create a function to return email addresses
- In the management console, select the folder to create your function in.
- Navigate to Cloud Functions.
- Create a function:
- In the top-right corner, click Create function.
- Enter the function name:
return-function. - Click Create.
- Create a function version:
- In the Editor window that opens, select
Node.js 22. - Disable Add files with code examples.
- Click Continue.
- Create a file named
index.jsand add the following code into it:module.exports.handler = async function (data, context) { return { result: "OK", emails: data.loaded_users.map(p => p.email) }; }; - Under Parameters, specify the following in the field:
- Entry point:
index.handler. - Service account:
sa-for-function.
- Entry point:
- Click Save changes.
- In the Editor window that opens, select
Create a workflow
-
In the AI Studio UI, select the folder where you want to create a workflow.
-
In the left-hand panel, expand Agent Atelier and select
Workflows. -
Click Create workflow.
-
Select the
YaML specificationmethod. -
Add the specification below. In the
functionIdfield:- In line 39, step
process_user_transform_info, specify thefilter-functionID. - In line 44, step
upload_users, specify thereturn-functionID.
yawl: "0.1" start: get_users defaultRetryPolicy: maxDelay: 10s retryCount: 2 errorList: - STEP_QUOTA_EXCEEDED steps: get_users: httpCall: url: 'https://jsonplaceholder.typicode.com/{{ .resource_type }}' method: GET headers: {} query: {} output: '{{ {loaded_users: .} }}' next: process_users process_users: foreach: input: {{ .loaded_users }} output: '{{ {loaded_users: .} }}' next: upload_users do: start: process_user_get_info steps: process_user_get_info: httpCall: url: https://jsonplaceholder.typicode.com/users/{{ .id }} method: GET headers: {} query: {} next: process_user_transform_info output: '{{ {user: .} }}' retryPolicy: retryCount: 2 errorList: - HTTP_CALL_500 process_user_transform_info: functionCall: functionId: <function_ID> upload_users: functionCall: functionId: "<function_ID>" input: '{{ {loaded_users, resource_type} }}' - In line 39, step
-
Click
Additional parameters and selectsa-for-functionin the Service account field. -
Click Create.
Run the workflow
-
Select a workflow.
-
Click
Execute. -
Enter input data in JSON format and click Execute.
Input data in JSON format:
{ "resource_type": "users" } -
When the workflow status changes from
RunningtoCompleted, the following JSON formatted result will appear in the Output data section:{ "result": "OK", "emails": [ "Sincere@april.biz", "Shanna@melissa.tv", "Nathan@yesenia.net", "Julianne.OConner@kory.org", "Lucio_Hettinger@annie.ca", "Karley_Dach@jasper.info", "Telly.Hoeger@billy.biz", "Sherwood@rosamond.me", "Chaim_McDermott@dana.io", "Rey.Padberg@karina.biz" ] }