# Repeat work with Routines

> Create, manage, and run Routines in Delegate to save reusable task workflows and execute them with a single click.

Routines are reusable workflows that you can run with a single click. They capture patterns of work you perform repeatedly, allowing you to automate common tasks without rebuilding them each time.

## What is a routine?

A Routine is a saved Delegate session that has been packaged for reuse. Unlike a one-off conversation, a Routine:

- Has a clear **trigger description** that explains when to use it
- Accepts **inputs** (parameters) that vary each run
- Produces a **consistent output** (document, report, update, etc.)
- Appears in your sidebar for one-click access
- Can be shared with teammates

Think of Routines as your personal automation library—workflows you design once and run whenever needed.

## When to create a routine

Create a Routine when you find yourself:

- **Asking Delegate for the same type of task weekly** (e.g., "Prepare my Monday morning brief")
- **Following a consistent process with varying data** (e.g., "Generate a status report from this Jira project")
- **Sharing a workflow with teammates** who need to perform the same task
- **Wanting to schedule automation** to run at specific times

## Creating a routine

There are three ways to create a Routine:

### Method 1: Save a successful session

To save a successful session as a Routine, take the following steps:

1. Complete a Delegate session that produces the result you want to reuse.
2. Select **Save as Routine** (appears in the conversation options).
3. Delegate analyzes the session and suggests:
   - A name for the Routine
   - Input parameters (what varies each time)
   - The output format
4. Review and edit the suggested configuration:
   - **Name**: Something descriptive (e.g., "Weekly Sales Report")
   - **Trigger**: When to use this (e.g., "When you need a summary of weekly sales data")
   - **Inputs**: What information is needed (e.g., "Week ending date", "Sales spreadsheet path")
   - **Output**: What the Routine produces (e.g., "PowerPoint presentation with charts")
5. Select **Save**.

The Routine now appears in your sidebar under **Routines**.

### Method 2: Create from scratch

To create a Routine from scratch, take the following steps:

1. Open **Settings** → **Routines** (or use the sidebar menu).
2. Select **Create Routine**.
3. Fill in the configuration:
   - **Name**: The display name in your sidebar
   - **Description**: What this Routine does
   - **Trigger**: Natural language description of when to use it
   - **Inputs**: Define parameters with names, types, and descriptions
   - **Steps**: Describe what Delegate should do (or paste a successful session transcript)
4. Select **Save**.

### Method 3: Edit a SKILL.md file

This method is for users comfortable with Markdown and file system configuration.

1. Locate your LocalSkills directory:
   - macOS: `~/Library/Application Support/UiPath/Delegate/LocalSkills/`
   - Windows: `%APPDATA%/UiPath/Delegate/LocalSkills/`
2. Create a new folder for your Routine (e.g., `my-routine/`).
3. Create `SKILL.md` inside the folder with the Routine definition.
4. Restart Delegate or refresh skills in Settings.

#### SKILL.md structure

```markdown
---
name: my-routine
friendly_name: Weekly Sales Report
version: 1.0.0
description: "Generates a weekly sales summary from spreadsheet data"
icon: FaChartBar
color: "3B82F6"
trigger: "When you need a summary of weekly sales performance"
inputs:
  - name: week_ending
    type: date
    description: "The last day of the week to report on"
  - name: data_file
    type: file
    description: "Path to the sales data spreadsheet"
output:
  type: file
  description: "PowerPoint presentation with sales charts"
---

## Steps

1. Read the sales data from {data_file}
2. Filter for the week ending {week_ending}
3. Calculate total sales, top products, and regional breakdown
4. Create a PowerPoint with:
   - Title slide: "Weekly Sales Report - {week_ending}"
   - Summary slide with key metrics
   - Chart slide showing product performance
   - Regional breakdown table
5. Save as "Sales_Report_{week_ending}.pptx" on the Desktop
```

## Running a routine

### From the sidebar

To run a Routine from the sidebar, take the following steps:

1. Look for the **Routines** section in the left sidebar.
2. Select the Routine you want to run.
3. Delegate prompts you for any required inputs.
4. Review the plan (if in Guided mode).
5. The Routine executes and produces the output.

### By mentioning it

In any conversation, reference the Routine by name:

```
Run the Weekly Sales Report for last week using the file in ~/Documents/Sales/
```

Delegate recognizes the Routine name and executes it with your specified parameters.

### Via keyboard shortcut

To run a Routine using a keyboard shortcut, take the following steps:

1. Press your configured shortcut (e.g., `Cmd+Shift+1`).
2. The Routine runs immediately (or prompts for inputs).

Assign shortcuts in Settings → Keyboard Shortcuts.

## Managing routines

### Favoriting

Pin frequently used Routines to the top of your sidebar:

1. Find the Routine in the sidebar.
2. Select the **star icon** (or open the context menu → **Add to Favorites**).
3. The Routine moves to the **Favorites** section.

### Editing

Update a Routine as your needs change:

1. Open the context menu for the Routine in the sidebar → **Edit**.
2. Or go to Settings → Routines → find the Routine → **Edit**.
3. Modify name, description, inputs, or steps.
4. Save changes.

**Note**: Editing a Routine does not affect past runs—only future executions.

### Duplicating

Create a variation of an existing Routine:

1. Open the context menu for the Routine → **Duplicate**.
2. A copy appears with "(Copy)" in the name.
3. Edit the copy to customize.

### Deleting

Remove a Routine you no longer need:

1. Open the context menu for the Routine → **Delete**.
2. Or go to Settings → Routines → **Delete**.
3. Confirm the deletion.

## Scheduling routines

Run Routines automatically on a schedule:

### Setting up a schedule

To set up a schedule for a Routine, take the following steps:

1. Go to Settings → Routines → find your Routine.
2. Select **Schedule**.
3. Configure:
   - **Frequency**: Once, Daily, Weekly, Monthly
   - **Time**: When to run (your local time)
   - **Inputs**: Fixed values or "prompt at runtime"
4. Save the schedule.

### Schedule options

The following table describes the available scheduling options.

| Option | Description |
|--------|-------------|
| **Run in Background** | Execute without stealing focus (recommended for scheduled runs) |
| **Notify on Completion** | Show a notification when done |
| **On Failure** | Retry, notify, or stop if the Routine fails |
| **Input Handling** | Use last values, prompt when due, or skip if inputs missing |

### Managing scheduled routines

View and manage all scheduled Routines:

1. Settings → Routines → **Scheduled** tab.
2. See upcoming runs, last run status, and history.
3. Enable/disable individual schedules.
4. Edit or delete schedules.

**Note**: Scheduled Routines run using your stored connections and permissions. If authentication expires, the Routine may fail until you reconnect.

## Sharing routines

Share Routines with teammates or the broader Delegate community:

### Export a routine

To export a Routine for sharing or backup, take the following steps:

1. Open the context menu for the Routine → **Export**.
2. Or go to Settings → Routines → **Export**.
3. Choose format:
   - **ZIP file**: Complete Routine folder (SKILL.md + any resources)
   - **SKILL.md only**: Just the definition file
4. Save to your desired location.

### Share with a team

To share a Routine with your team, take the following steps:

1. Export the Routine as a ZIP.
2. Share via your normal channels (email, Slack, shared drive).
3. Recipients import via Settings → Routines → **Import**.

### Publish to a marketplace feed

To publish a Routine to a marketplace feed, take the following steps:

1. Ensure your Routine follows the SKILL.md format.
2. Contact your UiPath administrator about your organization's Skill Marketplace feed.
3. Submit the Routine to the feed URL.
4. Team members can discover and install it via the Delegate Store.

**Note**: Publishing to public marketplaces requires UiPath review and approval.

## Routine best practices

### Design for clarity

- **Name descriptively**: "Weekly Sales Report" not "Report 1"
- **Write clear triggers**: Explain when someone should use this Routine
- **Document inputs**: Explain what each parameter is for and expected format
- **Specify outputs**: Describe what the user will receive

### Handle variability

- **Use input parameters** for anything that changes (dates, file paths, names)
- **Provide sensible defaults** where possible
- **Validate inputs** in the Routine steps (e.g., "Check the file exists")
- **Handle missing inputs gracefully** with fallback behavior

### Test thoroughly

- **Run in Guided mode first** to catch unexpected steps
- **Test with edge cases** (empty files, future dates, special characters)
- **Verify outputs** match expectations before sharing
- **Test on different machines** if sharing with a team

### Version control

- **Duplicate before major changes** to preserve working versions
- **Document changes** in the Routine description or a CHANGELOG
- **Use semantic versioning** in SKILL.md (1.0.0, 1.1.0, 2.0.0)

### Security considerations

- **Do not hardcode credentials** in Routine steps—use connections
- **Be cautious with file paths**—use relative paths or input parameters
- **Review permissions** before sharing—ensure recipients have access to required systems
- **Sanitize inputs** that go into shell commands or URLs

## Advanced: routine storage

Routines are stored as files on your machine:

```
LocalSkills/
├── my-routine/
│   ├── SKILL.md          # Routine definition
│   ├── references/       # Optional: supporting files
│   └── examples/         # Optional: example inputs/outputs
└── another-routine/
    └── SKILL.md
```

You can:
- **Back up** your Routines by copying the LocalSkills folder
- **Sync across machines** by placing LocalSkills in cloud storage (Dropbox, OneDrive)
- **Version control** by initializing the folder as a Git repository

**Note**: If you sync LocalSkills, be careful with absolute paths in Routines—they may not work on different machines.

## Next steps

Learn how to:

- [Share work with the Delegate Store](delegate-store.md) — Find pre-built Routines and Skills
- [Review the Settings reference](settings-reference.md) — Configure Routine storage and scheduling
- Create your first Routine from a recent successful Delegate session
