Creating a Workflow for hosting a Web API
This topic explains how to create a Workflow for hosting a Web API.
note
A Web API must have been created, saved and compiled before you can perform the steps in this topic. For information, see Creating a WebAPI.
- Create a new Workflow and open the Workflow Designer.
- Select Workflow -> Modify Assembly References…
- In the left-hand pane, select Web APIs.
Note. The Web API must be compiled to be visible in the list. - Select the Web API that you want to host. Click OK.
- Locate the Execute Web API Definition activity in the activity toolbox. Drag it into the designer area.
- Set the following arguments on the activity:
- Web API: select the Web API that you want to host.
- Arguments: set the Startup argument (the same type as defined on the Startup class in the Web API). Note. When a reference has been created, the types from the Types.cs document is available in the Workflow and can be passed on to the Execute WebApi Definition activity.
- Endpoint: set the endpoint address for the hosted Web API (for example http://localhost:5000).