# Complete workflow task programmatically
Use this action to complete a workflow task programmatically. For example, you can use it to perform a workflow task in a different UI (including Workbot for Slack or Microsoft Teams), or to close a task that is no longer valid.
# Input
Workflow app
Select a Workflow app in which to complete a task.
Record ID
Choose a request (identified by its Record ID) to update. Use a datapill or enter the exact ID. Workato automatically generates a unique ID for each record in a workflow app's corresponding data table.
Task status
Complete a task by approving or rejecting it.
Email address
(Optional). Provide the email address of the assignee you plan to complete the task. If this field is left empty, Workato defaults to the currently assigned user.
# Output
Output is dynamic and may vary depending on the actions and triggers in your recipe, as well as the columns present in your Workflow app's corresponding data table.
To use this data in downstream steps, map in the relevant datapill from the datatree.
- Task
- This JSON object includes the following available attributes.
- Task ID
- Workato automatically generates a unique ID for each task in a Workflow app.
- Task name
- The name of the task.
- Status
- The task's status.
Available values include:
- Approved:
- The status if the task was completed using a button with the Complete task action and its outcome is Approved.
- Rejected:
- If the task was completed using a button with the Complete Task action and its outcome is Rejected.
- Expired:
- If the task was not completed in time.
- Is approved
- Whether the task was completed with Approved status.
- Created at
- The date the task was created.
- Completed at
- The date the task was completed.
- Completed by
- A nested JSON object within the Task object describing the user that completed the task.
- If the task is expired, this object may be empty.
Available attributes include
- User ID:
- The user's ID.
- Task name:
- The name of the user who completed the task.
- Email:
- The user's email address.
- Request
- This JSON object includes the following available attributes. Additional output is available depending on the Workflow app you select and its data table.
- Record ID
- Workato automatically generates a unique ID for each record in a Workflow app's corresponding data table.
- Active task
- A nested JSON object within the Request object.
- This object is empty if there is not an active task associated with the request.
Available attributes include
- Task ID:
- The ID of the task.
- Task name:
- The name of the task.
- Status:
- The task's status.
- Assigned user:
- A nested JSON object within the Assigned task object.
- This object is empty if the task is assigned to a group.
Available attributes include
- User ID:
- The ID of the user assigned to the task.
- User name:
- The name of the user assigned to the task.
- Email:
- The email of the user assigned to the task.
- Status:
- The status of the user assigned to the task.
- Assigned group:
- A nested JSON object within the Assigned task object.
- This object is empty if the task is assigned to an individual user.
Available attributes include
- User ID:
- The ID of the user assigned to the task.
- User name:
- The name of the user assigned to the task.
- The email of the user assigned to the task.
- Status
- The status of the user assigned to the task.
- Due date:
- The due date of the task.
- Task URL:
- The URL for the task.
- Created by
- A nested JSON object within the Request object.
Available attributes include
- User ID:
- The ID of the user who created the request.
- User name:
- The name of the user who created the request.
- Email:
- The email of the user who created the request.
- Status:
- The status of the user.
- Groups
- A nested JSON object within the Created by object.
Available attributes include
- Group ID:
- The ID of the group this task is assigned to.
- Group name:
- The name of the group this task is assigned to.
- List size
- List index
- Stage
- A nested JSON object within the Request object.
Available attributes include
- Stage ID:
- The ID of the group this task is assigned to.
- Group name:
- The name of the group this task is assigned to.
- Created at
- The date the record was created.
- Updated at
- The date the record was most recently updated.
Last updated: 6/12/2024, 7:06:15 PM