# Implementing a simple process

> Getting started in Maestro can be as simple or as advanced as your use case requires. A simple process might involve a few connected steps—such as receiving an input, running an automation, and returning a result—ideal for quick proofs of concept or straightforward business flows. This section introduces you to a simple flow so you can get used to the basics.

## Overview

Getting started in Maestro can be as simple or as advanced as your use case requires. A simple process might involve a few connected steps—such as receiving an input, running an automation, and returning a result—ideal for quick proofs of concept or straightforward business flows. This section introduces you to a simple flow so you can get used to the basics.

This guide demonstrates how to implement a simple process that highlights the core agentic orchestration capabilities: modeling, implementation, debugging, publishing, deployment, and management. The process does not cover integration with other UiPath products. For instructions on setting up and implementing dependencies such as Data Fabric, Integration Service, Studio Web, Agents, and Action Center Action Apps, see [How to – Complex Process](https://docs.uipath.com/maestro/automation-cloud/latest/user-guide/how-to-complex-process#implementing-a-complex-process).

The aim is to build the simple routing process similar to the one from the following image:

![Simple process BPMN diagram with a start element, a gateway, two tasks, and two end events](https://dev-assets.cms.uipath.com/assets/images/maestro/maestro-docs-image-538668-08eae19e.webp)

## Model a process

:::note
* Agentic process project configuration is currently tenant-bound. Make sure that you remain in the same tenant between editing sessions.
* Agentic process project configuration currently supports only one business process (.bpmn) file. Although you can add multiple files to the project, this leads to unexpected issues for both debugging and publishing.
:::

Start by modeling the end-to-end process, then configure the components.

Create an agentic process as a new type of Studio project.

1. Navigate to your Automation Cloud™ tenant.
2. On the rail on the left side, from the list of products, select **Maestro**.
3. On the **Maestro** landing page, select **Start modeling**. Your new agentic process opens.

   You can also start by creating a new **Agentic Process** in **[Studio Web](https://docs.uipath.com/studio-web/automation-cloud/latest/user-guide/creating-an-agentic-project)**.

   ![agentic orchestration type process](https://dev-assets.cms.uipath.com/assets/images/maestro/maestro-agentic-orchestration-type-process-597029-1e7e8552.webp)

4. Open the context menu to rename the project to **Simple Process**, and the process to **Simple Process**. Your agentic process is, by default, part of a solution. Read about solutions in the [Studio Web user guide](https://docs.uipath.com/studio-web/automation-cloud/latest/user-guide/about-solutions).

   ![rename simple process](https://dev-assets.cms.uipath.com/assets/images/maestro/maestro-rename-simple-process-597034-6c904375.webp)

5. Select the start element and select **Add: Text annotation** from the toolbox and Enter **Input variable path**.

   ![add text annotation](https://dev-assets.cms.uipath.com/assets/images/maestro/maestro-add-text-annotation-597038-7c1265f7.webp)

6. Select the start element and select **Add: Intermediate event** from the toolbox.

   ![add intermediate event](https://dev-assets.cms.uipath.com/assets/images/maestro/maestro-add-intermediate-event-597042-e2ef2a87.webp)

7. Select **Change element** from the toolbar and select **Timer intermediate catch event** and Enter **Delay** for the intermediate event name.

   ![timer intermediate catch event](https://dev-assets.cms.uipath.com/assets/images/maestro/maestro-timer-intermediate-catch-event-597143-8872f138.webp)

8. Select the timer element and select **Add: Exclusive gateway** from the toolbox and Enter **Which path?** for the gateway name.

   ![Timer element selected with tooltip showing "Add: Exclusive gateway"](https://dev-assets.cms.uipath.com/assets/images/maestro/maestro-docs-image-597148-d247c935.webp)

9. Select the gateway and select **Add: Task** and Enter **A task** for the name.

   ![A task element added to the canvas and connected to the gateway](https://dev-assets.cms.uipath.com/assets/images/maestro/maestro-add-task-597152-6c85e659.webp)

   Validation errors are shown in the lower-left corner of the canvas.

   ![Validation error indicators shown in the lower-left corner of the canvas](https://dev-assets.cms.uipath.com/assets/images/maestro/maestro-validation-issues-597159-42b4a69d.webp)

10. Select the gateway again and select **Add: Task** and Enter **B task** for the name.

    ![Canvas showing Which path gateway with A task and B task connected](https://dev-assets.cms.uipath.com/assets/images/maestro/maestro-which-path-597172-bac34296.webp)

11. Select the gateway and expand the first condition, it will have a generated name starting with`edge_Gateway_{randomcharacters}` and Enter A for the Label. Expand the second condition and Enter B for the Label.

    ![Gateway conditions configured with labels A and B](https://dev-assets.cms.uipath.com/assets/images/maestro/maestro-conditions-597210-2f40f43e.webp)

    ![Condition labels A and B applied to the gateway outgoing flows](https://dev-assets.cms.uipath.com/assets/images/maestro/maestro-condition-labels-597214-d99ff7a7.webp)

12. It is a best practice to create an explicit end to your process. To quickly identify which path the process followed, create an explicit end for each one. Select the **A task** and select **Add: End event** from the toolbox and Enter **End A** for the name.

    ![End A](https://dev-assets.cms.uipath.com/assets/images/maestro/maestro-end-a-597221-64f776ca.webp)

13. Select the **B task** and select **Add: End event** from the toolbox and Enter **End B** for the name.

    ![End B](https://dev-assets.cms.uipath.com/assets/images/maestro/maestro-end-b-597225-2e985abf.webp)

Congratulations! You’ve now created your first BPMN end-to-end process!

Now add some capabilities to the process.

## Implement a process

**Start event**

1. Select the start element and in the Properties panel Enter **Manual start** for the Name and, in the Arguments section, select **Add new** to add a variable which we can use when we start the process.

   ![properties start event](https://dev-assets.cms.uipath.com/assets/images/maestro/maestro-properties-start-event-597229-e5e01db4.webp)

2. Configure the variable with these values and select **Save**. An output variable will automatically be created.
   * Name: path
   * Type: String
   * Value: A

   ![Add variable dialog with Name path, Type String, and default value A](https://dev-assets.cms.uipath.com/assets/images/maestro/maestro-add-variable-597242-5ec02ab0.webp)

   ![Start Event input arguments in the Properties panel](https://dev-assets.cms.uipath.com/assets/images/maestro/maestro-start-event-input-arguments-597254-26fea071.webp)

3. Select the **Delay** event and open the properties panel and in the **Timer** section select Type=**Duration** and **5 seconds** in the value configuration.

   ![Timer event configured with Duration type and 5-second value](https://dev-assets.cms.uipath.com/assets/images/maestro/maestro-duration-597303-b4005459.webp)

4. Select the gateway and expand the Conditions to enter the condition for the No and Yes paths, and select the text entry picker to open the **Expression editor** to enter the conditions.

   ![Expression editor open for gateway condition configuration](https://dev-assets.cms.uipath.com/assets/images/maestro/maestro-expression-editor-597307-b3d5a52f.webp)

5. Use **Insert variable** to find and insert the **Manual start** output variable `path`.

   ![Variable inserted into the expression editor](https://dev-assets.cms.uipath.com/assets/images/maestro/maestro-use-variable-597311-ad416392.webp)

   Set the value equal to “A”, and select **Save**.

   ![insert variable A](https://dev-assets.cms.uipath.com/assets/images/maestro/maestro-insert-variable-a-597317-d8b277c9.webp)

6. Open the Expression editor for condition B and insert the **Manual start** output variable **path** and set the value equal to “B” and select **Save**.

   ![Insert variable B in the expression editor](https://dev-assets.cms.uipath.com/assets/images/maestro/maestro-docs-image-597338-dd385e7a.webp)

   Alternatively, you can simply copy/paste the expressions below into expression editor:
   * A

     ```
     vars.path == "A"
     ```

   * B

     ```
     vars.path == "B"
     ```

Congratulations! You’ve now fully configured your first process.

:::note
You can download the BPMN for use in other projects by opening the context menu for the `.bpmn` file name.
:::

## Debug a process

You can configure breakpoints by pointing to the upper left of an element and selecting **Click to add a breakpoint**. Currently, breakpoints can only be set once you start debugging a process. However, they are retained between runs. Read about [debugging and breakpoints](https://docs.uipath.com/maestro/automation-cloud/latest/user-guide/debugging).

![Gateway selected with tooltip showing "Click to add a breakpoint"](https://dev-assets.cms.uipath.com/assets/images/maestro/maestro-docs-image-597344-97226822.webp)

**Debug straight through**

First, run your process straight through to ensure you’ve configured it correctly. Set the default value for your `path` variable to **A** so you should see it flow through to **A task** and **End A**.

1. Select **Debug** to test your process.

   ![Debug panel showing process execution started](https://dev-assets.cms.uipath.com/assets/images/maestro/maestro-debug-panel-597359-cc491f66.webp)

2. Watch how each step is executed. Navigate the **Execution Trail** and **Global Variables/Incidents** sections to view additional details.![simple process debug](https://dev-assets.cms.uipath.com/assets/images/maestro/maestro-simple-process-debug-607415-5e13eda2.webp)
3. Select **Back to design mode** to exit Debugging.

**Debug step-by-step**

Run your process step-by-step so you can manipulate the `path` variable to test route **B**

1. Select **Debug step-by-step**.

   ![Debug step-by-step panel](https://dev-assets.cms.uipath.com/assets/images/maestro/maestro-docs-image-597366-1a867781.webp)

2. Select **Next step** to move execution to the timer

   ![Next step button highlighted in the debug toolbar](https://dev-assets.cms.uipath.com/assets/images/maestro/maestro-next-step-597371-4b700434.webp)

3. Update the `path` Global variable for the **Manual start** event source to **B**. Select Enter or tab to commit the change.

   ![Global Variables panel showing the path variable value](https://dev-assets.cms.uipath.com/assets/images/maestro/maestro-global-variables-597386-594b1391.webp)

4. Select **Update 1 variable** and **Update variables** in the next dialog to commit the changes.
5. Select **Continue** to finish the execution.
6. Watch how each step is executed. Navigate the **Execution Trail** and **Global Variables/Incidents** sections to view additional details. This time, the process follows the B route.

   ![process route B](https://dev-assets.cms.uipath.com/assets/images/maestro/maestro-process-route-b-597390-b0ff549f.webp)

7. Select **Back to design mode** to exit Debugging.

.

## Publish and deploy a simple process

1. Select **Publish**.
2. Choose the **Location** and select **Publish**.

   ![Publish dialog showing the Location selector](https://dev-assets.cms.uipath.com/assets/images/maestro/maestro-publish-solution-599845-d384cbea.webp)

3. Read [Publishing and upgrading agentic processes](https://docs.uipath.com/maestro/automation-cloud/latest/user-guide/publishing-deploying-and-upgrading-agentic-processes) for the steps to publish to Orchestrator.

Congratulations! You’ve now fully published, deployed and started your first process.

Now it's time to do runtime instance management.

## Manage a business process

1. From the Automation Cloud portal, navigate to the **Maestro** service.
2. Select **Simple Process** in the list of processes to open the **All instances** view for your process. You can use search to filter the list if needed.

   ![All instances view for the Simple Process](https://dev-assets.cms.uipath.com/assets/images/maestro/maestro-simple-process-597427-da4666db.webp)

3. Select the latest instance to open the instance viewer. You will see the process execute live through each step (assuming the 5 second delay timer is still executing).

   ![Instance viewer showing the process executing live](https://dev-assets.cms.uipath.com/assets/images/maestro/maestro-simple-process-597431-2a688db5.webp)

Select the model background to see **Global variables** and **Action History** as well as the **Execution trail**. Select a node in the model or the Execution trail to inspect Details and Variables for that execution step. Congratulations! You’ve now fully managed your first process. Now break our process so you can fix it!

## Break and fix a process

In this procedure, we will cause a failure in the execution in order to use the instance management to recover.

1. Go to Orchestrator, to the **Automations** tab for **My Workspace** folder and find **Simple.Process** in the **Processes** list.
2. Select **Start a Job** for the **Simple.Process** entry but this time edit the **Arguments** before starting to break it.
3. Select the **Arguments** tab and edit the `path` variable. Set the value to **C** and select **Save**.

   ![Arguments tab with the path variable value set to C](https://dev-assets.cms.uipath.com/assets/images/maestro/maestro-arguments-path-597436-6a73122e.webp)

4. Select **Start**.
5. Navigate to Maestro and select **Simple Process** in the list of **Processes** to open the **All instances** view for your process.

   ![all instances view](https://dev-assets.cms.uipath.com/assets/images/maestro/maestro-all-instances-view-597444-98b22eec.webp)

6. Select the **Which path?** gateway step to see the **No outgoing flow for gateway** error which is to be expected since we have no configuration for `path==”C”`.

   ![Validation panel showing No outgoing flow error on the gateway](https://dev-assets.cms.uipath.com/assets/images/maestro/maestro-errors-597448-3a0d5ecf.webp)

7. Select the first step container or the model background to view the **Global variables**.

   ![Global Variables panel](https://dev-assets.cms.uipath.com/assets/images/maestro/maestro-global-variables-597456-7589cd69.webp)

8. Ensure the flow will follow a configured condition by updating the `path` variable for **Manual start** output (the second one) to **A**.

   ![manual start C](https://dev-assets.cms.uipath.com/assets/images/maestro/maestro-manual-start-c-597461-be8157b6.webp)

9. Select **Update 1 variable** to update the variable and add a comment for audit purposes.

   ![Update variables dialog with comment field](https://dev-assets.cms.uipath.com/assets/images/maestro/maestro-update-variables-597465-d8fd79f6.webp)

10. Select **Retry**, add a comment and choose **Retry instance** to retry the step with the new variable and watch the instance complete.

        :::note
        You might need to refresh the page to see the instance complete.
        :::

        ![Retry instance dialog with comment field](https://dev-assets.cms.uipath.com/assets/images/maestro/maestro-retry-instance-597470-64bdf93f.webp)

11. Look at the **Action History** to see the audit trail for our changes.

    ![Action History panel showing the audit trail](https://dev-assets.cms.uipath.com/assets/images/maestro/maestro-action-history-597474-27883815.webp)

Congratulations! You successfully fixed a broken instance.

## Migrate between versions of a process

The current process flow logic is insufficiently robust to manage all path scenarios. You are addressing this issue by publishing a new version of the process. This updated version will effectively accommodate not only new process instances, but will also rectify existing, problematic instances. To ensure you effectively handle all scenarios where `path` does not equal `A`, modify the **B** route to a **Not A** route.

In this procedure, you will cause a failure in the execution in order to fix it with a new version.

1. Navigate to **Orchestrator**.
2. Go to **My Workspace**.
3. Go to the **Automations** tab and find **Simple.Process** in the **Processes** list.
4. Select **Start a Job** for the **Simple.Process** entry and choose **Start**.
5. Select the **Arguments** tab and edit the `path` variable.
6. Set the value to **C** and choose **Save**.
7. Select **Start**.

Now fix your process so you can migrate this broken instance.

1. Open your Simple Process in **UiPath Studio**.
2. Select the **Which path?** gateway and open the properties panel.
3. Change the **B** label to **Not A** and change the condition to `vars.path != A`

   ![Gateway conditions updated with Not A label and expression](https://dev-assets.cms.uipath.com/assets/images/maestro/maestro-vars-path-598008-82a1518d.webp)

4. Change the task **B task** name to **Not A task**.
5. Change the end event **End B** name to **End Not A**.
6. Select **Publish**, choose **Orchestrator Personal Workspace Feed**, and select **Publish**.

Now migrate your broken instance to the new version.

1. Navigate to Maestro, select **Process instances**, and choose **Simple Process** in the list of Processes to open the **All instances** view for your process.
2. Select the latest instance to open the instance viewer. You will see the process is in a failed state at the **Which path?** gateway.

      :::note
      You might need to select the refresh button for the list to see the latest instance.
      :::

3. Select **Migrate**, choose the **Target version** for the process you just published (it should be **1.0.1** but might be different for you), provide a comment and select **Migrate instance**.

   ![Migrate instance dialog with Target version selector and comment field](https://dev-assets.cms.uipath.com/assets/images/maestro/maestro-migrate-instance-598013-c83ed9e9.webp)

4. Select **Retry**, add a comment, and select **Retry instance** to retry the step with the new variable and watch the instance complete.

      :::note
      You might need to refresh the page to see the instance complete.
      :::

      ![Retry instance dialog for the migrated version](https://dev-assets.cms.uipath.com/assets/images/maestro/maestro-retry-instance-598019-64bdf93f.webp)

5. Look at the **Action History** to see the audit trail for your changes.

Congratulations! You successfully migrated a broken instance to a new version of the process!

## Final process

This is how the final process looks:

   ![Final BPMN diagram of the completed simple process with gateway, two tasks, and two end events](https://dev-assets.cms.uipath.com/assets/images/maestro/maestro-final-process-598027-7f6cd9dc.webp)
