Invoke API and Server Flow Asynchronously
Follow the below sections to invoke an API and Server flow asynchronously.
Create a Server Flow
In the context of leave management application, follow the steps given in Create Server Flow to create a server flow with the following configuration.
- Name: GetEmployeeAvailableLeaves
- Expose as API: Yes
- Async Operation: Yes
- Verb Type: Get
- Produces: JSON
- URL: employeeflows


Configure REST API
Follow the steps given in Call REST API and configure the REST API with the below configuration.
- API Definition: CreateAnnualLeaveRecord
- Execution Mode: Async
- Input As Raw Data: No
- Output As Raw Data: No
- Activity Handle: sa
- Activity Response: saResponse
When an API Execution Mode is configured as Async, user must provide an assignment statement to wait for a promise and return its result. Here the assignment status expression is as follows.
CRResponse = await CR;
