# Actions. Part 1 - Recognition of Incoming Invoice

Let's consider an example of a robot that is the first part of the project and demonstrates working with Actions in the Orchestrator. You can see how it looks on the Orchestrator side [here](https://docs.sherparpa.ru/en/sherpa-rpa/sherpa-orchestrator/rabota-v-sherpa-orchestrator/ekrany/deistviya/primer-sozdaniya-deistviya-i-ego-nastroiki). At this stage, the robot recognizes data from the pdf document “Supplier Order 1.pdf”, after which the obtained data is set as task parameters, and this task is created in the specified queue ($QueueGuid).

When creating the task, the tag "1CNew" ($TaskTag) is specified. Also, in the task parameters, a link to the uploaded pdf file in the storage is specified ($StorageGuid).

The first part of the robot project consists of two diagrams and a pdf file.

Thus, if we describe step by step, this robot works as follows:

1. Uploads the file to the specified folder in the Orchestrator's storage.
2. Launches the diagram “DataRecognition”.
3. Creates a task in the Orchestrator and adds it to the specified queue.

**The main diagram of the project** looks like this (for convenience, the blocks of the diagram are numbered):

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXdsHqPG9wLH5ijAktbYb2nSOkgksiX8DNBBClhVnG3ROxWDQ3NTPFmgocj5G92KnUH7GV_7N-_l092y3VUYO4NRt2n5bCajzRSM-GNOwHxCdASBWgXbRGWgGoyO_Zl3Aweq3QOsqNGG_BPGXK4zL7ihkdel?key=seA-VcSXuVgZZHNoZg11MA" alt=""><figcaption></figcaption></figure>

1. **Block “Start”** (any diagram starts from this block).
2. **Block “Storage. Create File”** creates a pdf file in the selected file group. The following properties are specified for this block:

* GUID/Name of the file group (GUID of the file group (folder) in the Orchestrator where the recognized pdf document will be uploaded);
* File name;
* File path (path to the file on disk).

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXdjFcwwyRs1zkgIknpIUqD3BrW6JsKSfgDp2WJDxCl3vaIaNAATTGyw_RjhVcN_mAbmwTWZ_Yue817hlD5irsyW6juBewor4rw6-oNrSTcXohjdA63UQc1lKBH-kDA3dDY6amP6ZjwbcBzwCAwnzYmkhKc?key=seA-VcSXuVgZZHNoZg11MA" alt=""><figcaption></figcaption></figure>

3. **Block “Process”** allows creating scenarios consisting of several diagrams. The execution of the scenario will continue from the “Start” block of the specified project diagram. The execution of the scenario will return to the current block and continue in the current diagram as soon as the “End” block is reached in the external diagram. For the “Process” block, the property “Diagram Name” is specified (the name of the diagram file where the scenario execution will continue).

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXfizBIDUs5wsopSHda0hrSNPriAS7LorkuAuEKomcb60SrJDMpbVbQ1MnDQqxNWbrB3T92VT1PAmF1BUipXTKjhQQEYO-JR1z1Ul7atHEFqy8f1eNwL3O5GHwNGGGl3zxZ-ATNNKj-hEUXNZqjgbw0fmwer?key=seA-VcSXuVgZZHNoZg11MA" alt=""><figcaption></figcaption></figure>

4. **Block “Add Task to Queue”** creates a task and adds it to the queue. The following properties are specified for this block:

* GUID/Name of the queue (GUID of the queue in the Orchestrator where the task will be added).
* Title (the name of the task that will be added to the selected queue in the Orchestrator);
* Parameters (task parameters that will be set after recognizing data from the pdf file);
* Priority (task execution priority);
* List of tags (tags for the task being added to the queue);
* Timeout (timeout for a response from the server in seconds).

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXd_z1XMqoXAzc4CRcJFnWXZ7XyrE-Wl_uq0oCacMUrapFRUcFFknC6fMdJ0Sx9zPbLA9mvtbJTtPMNr4sCcV2eXNNEKXe4Itonz3QGqB3qum_hD_nJVhDWHRcUus9i_ItGYFcjGixVr-Jn6LuxrVXqqtnRB?key=seA-VcSXuVgZZHNoZg11MA" alt=""><figcaption></figcaption></figure>

5. **Block “End”** (this block completes the scenario execution or returns the subprocess diagram to the main process).

**Diagram “DataRecognition”**

<br>

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXcrLDZs83DoFtGLDKPf9kBJMfNtQs0fhk5A8UlS3c9i8i7i6izjgcEaP5uQVOIp2iNIx7M7U-s7r-rNXHxXGO2UmXvwTLpcrq03drQyIVY_dbsKpiYwRpA7xpa3Cp9uFJtraHmJMGZnYeZB62zwQYP7T34S?key=seA-VcSXuVgZZHNoZg11MA" alt=""><figcaption></figcaption></figure>

1. **Block “Start”** (any diagram starts from this block).
2. **Block “Recognize by Template”** allows recognizing a document by a template previously created in the [Template Designer](https://docs.sherparpa.ru/en/sherpa-rpa/shablonizator). The following properties are specified for this block:

* File path;
* Template file path (path to the template file for recognition).

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXfzrGz4zskniiUAmSjiSUOyBw1fHgSahdJIP8rXNg9pao-hHxpwDp9h6X_7cAqWa-XBDFAGCIDLl76Ui3n-quZRkJSowarvK8Bbn7qEsOFE9qOoFV1vRep5h1s8lfQmPQdfz3M0iJaDQDn5xATrdtM-xOU?key=seA-VcSXuVgZZHNoZg11MA" alt=""><figcaption></figcaption></figure>

3. **Block “Assign Value to Variable”** sets new values for one or more variables. In this case, two values are specified to be assigned to variables.

In this case, the specified variables are the values of the cells “Supplier” and “Order”. The variable “Supplier” is assigned a value from the attribute dictionary by the key "Executor". The variable “Order” is assigned a value from the key "Order".

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXcjEIl2E_xYfw7ics1wWxAlgv5SJMd_JEMyC_zMv4b_vun1aczzJV0QdAckzm9b0AYw7vbS-P5agEvDbgDU-zv7cEb9MKnsZys4PJ8Fp6BWvedZpK0iMBdLm6anV_RRhGRu2kLjesrHdfpH--IFbnbx_OSH?key=seA-VcSXuVgZZHNoZg11MA" alt=""><figcaption></figcaption></figure>

4. **Block “For Each Loop”** iterates over all rows of the data table.

   <figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXe8L9rjRdOFnROXlZ8et_Lzx70w61uaOrPSf9TsYAQvjB8LbzWLHmMn7rgivvE7YimbN6L0FYYl-LR-fgEYPtgTGzEKRxyF1EPMGGuYf0oSlHpQUovUq1zs6RTd-bWfKPVyPBvF1XzUSLsz-lk1nXB15D7R?key=seA-VcSXuVgZZHNoZg11MA" alt=""><figcaption></figcaption></figure>
5. **Block “Log”** allows outputting arbitrary messages and/or variable values to the log during the robot's scenario execution. In this case, three such blocks are used, and for them, the property “Value” (each block has its own) and the message level when sending the log to the Orchestrator are specified. The text constant is indicated in quotes, and the variable name starts with the $ symbol, specified using the variable. That is, in this case, messages about recognizing data about “Supplier”, “Order”, and “Goods” are recorded in the robot's log.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXf3n0PaFWOFWPjoMkTuJgTaa-MflntCAKZspQPD2Xqes6NZTtEN1Ge-Osplpaj0jCI7cEd5ciNWdTzfuX67rAfbxgoUmO6p6BPb1aGRyf6dVVTsbtBGznd2NXjBCFzuKbfdg0sR7Dil25uKZmePRnumeNPY?key=seA-VcSXuVgZZHNoZg11MA" alt=""><figcaption></figcaption></figure>

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXcrU5Rbtq2rXYJ5l0MbipRy-2oq0za4zY0My1271r6CQk21aKLPaU2OWN_AFhpzkeuY_sreP1annWh7KP1nL0OGZJkIw0GpLdwlQ-YkJ9fwaj9gt1ZuFRyAWOpLP4VaaRfnRZdlRVGaPB_T4CSswFV9YktD?key=seA-VcSXuVgZZHNoZg11MA" alt=""><figcaption></figcaption></figure>

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXd_P-KwQyUvwIuGzyTyHeXvwViTGaQP86LdZCSzE75BmsWzMg0jHcP_wvYR5XvE1DXfg7PSCUU4ryNDNT6lqcvyAxYNaEvwPZUIwTrkM-zO1faEA187PgKJLhKEN3WB_xT6_eOTxTtgok7iy7_zARZKjLnN?key=seA-VcSXuVgZZHNoZg11MA" alt=""><figcaption></figcaption></figure>

6. **Block “Assign Value to Variable”** sets new values for one or more variables. In this case, the values of the columns are taken and assigned to their variables.

   <figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXcod0XjQKKYkWYVOlS4QtxEOA6nqhZcTaeSguJnT_coWouNIU_YVYjU8XB9bKEe34QSDWbpL3sD5WX_nFBeJHqnoX7x_ubZUbT5_y2KwLJsxGmJA1EElWXla87pTlfRWtB9uu7x8IqcvaHfIuSm7WrwfF78?key=seA-VcSXuVgZZHNoZg11MA" alt=""><figcaption></figcaption></figure>
7. **Block “Add Row”** allows adding a row to the data table. In this case, the following properties are specified:

* Table (the data table to which the row is added);
* Values (list of values for the new row);
* Row number (returns the number of the added row, numbering starts from 0).

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXevzHQrKoH3DAf3oAclDKvp1g-2MlNaXKwLNcO_YIWtuz81Zppg-rBPm7SJB8fPDYX1SEExXDhxBkYKQZIJNnXULZrW_iyzMs0T-XoDHs74V6KN3lc1gWkfFtTVSaABXpRjIueFDSOqrW_kk27h1cmxNZWE?key=seA-VcSXuVgZZHNoZg11MA" alt=""><figcaption></figcaption></figure>

8. **Block “End”** (this block completes the scenario execution or returns the subprocess diagram to the main process).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.sherparpa.ru/en/sherpa-rpa/sherpa-designer/primery-robotov/actions/actions.-chast-1-raspoznavanie-prikhodnoi-nakladnoi.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
