UiPath Developer

The UiPath Developer Guide

The Simple Activity

Add the standard UiPath activity to your package



Now that you have your package created, let's add an activity to it! In this example, you will create the activity shown above: a simple one that adds two numbers together.

What You'll Need


1) Open the Activity Creator

Start by opening the Visual Studio solution created in the previous section and select any of the main projects (these are the ones labeled MyCompany.MyProduct...) in the Solution Explorer. Then navigate to Extensions > UiPath > Add Activities in the toolbar. Note that this menu will be disabled until one of the projects is selected.


2) Build an Activity

This will open a new Activity Creator window. The first screen gives you two options:

  1. Create: Build one or more activities from scratch.
  2. Import: Import a list of predefined activities that have been saved in a standard format.

For now, select Create.


3) Define the Activity

Click the Add button and fill in each field as shown below. This will prepare the creator to build an activity named Addition. When ready, click the Edit button to add properties to the Addition activity.


4) Add Properties

This will open a new Define Properties window. Use the Add button to create 3 properties as shown below.
Ensure that the first two are inputs and the last is an output. These properties will represent two numbers and their sum.


5) Generate the Activity

Click OK on the Properties window and Finish on the activities window. You will then see some new files added to your projects.


6) Add Functionality

Open the Addition.cs file that was just created and expand the Protected Methods region within it to reveal the activity's ExecuteAsync method. This is the method that gets called whenever the activity is run in UiPath Studio.
Notice that the two inputs created in step 4 (First Number and Second Number) as well as the one output (Sum) have already been added to this method. The final step is to bridge the gap between them by replacing the comment block with code that adds the two inputs and then sets the result to Sum. See below:


7) Build the Package

Within the Solution Explorer, right-click your Design project and select Publish. This option builds your projects, packages them together, and sends the package wherever you'd like.


In the next screen, enter the folder in which you'd like to save your activity package. It's a good idea to choose one of your package sources from UiPath Studio (you can find these at Settings > Manage Sources on the Studio homepage) so you can publish directly from Visual Studio into UiPath Studio.
Click Create Profile to continue.


On the next page, rename your package source to UiPath Packages (or whatever you'd like) and change the configuration to Debug. Then click Publish.
For more info on Debug vs Release configurations, see Package Metadata.


Your output will then show that all three projects have been built successfully and the resultant package published. You now have a working activity package!


8) Use Your Activities in UiPath Studio

Open UiPath Studio, navigate to the Package Manager, and add your activity set to workflow.


Notice that a new category has been added to the Activities pane.


That's all! Give your new activity a try!


Updated about a year ago

See Also

Continue on to learn how to set package metadata, such as the icon, author, license, project URL, etc.

Package Metadata
Customizing Activities
Customizing Properties

The Simple Activity

Add the standard UiPath activity to your package

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.