Tasking Setup

Tasking Setup

Overview

Tasking lets you define and assign short prerequisite activities — called Tasks — to field workers. A task must be completed by a given due date. Completion is recorded automatically based on the task type. Connect supports two task types:

  1. Relearn: The user submits one or more forms using a CommCare application, configured on CommCareHQ.

  2. OCS: The user dialogue with a chatbot configured on Open Chat Studio.


Relearn Task

This section covers the changes needed in your CommCare HQ application to support Tasking. These steps are specific to this feature and are separate from the standard Connect app setup.

Register Task Units

Each form in the HQ app that corresponds to a Connect Task must be registered as a Task Unit:

  • In the CommCare application builder, go to the task form's settings.

  • Register the form as a Task Unit under the app's Connect settings.

  • Each Task Unit gets an ID (slug) — note this down carefully. It must be entered exactly when creating a Task Type in Connect.

Task Form — Conditional Visibility

The task form should only appear for a worker once they have been assigned that task. Control this with a case property:

  • When creating a Task Type in Connect, set a Case Property (e.g. training_complete).

  • Connect sets this property to 1 on the worker's CommCare user case when the task is assigned.

  • In the HQ app, add a relevance condition to the task form: show only when the case property equals 1.

  • On the worker's next sync, the form becomes visible.

Example — Training Task end-to-end

  • Task Unit ID registered in HQ app: community_training

  • Task Type created in Connect: slug = community_training, case property = training_complete

  • Worker is assigned the task in Connect → HQ user case updated: training_complete = 1 → training form appears in app on next sync

  • Worker submits the form → Connect automatically marks the task as Completed

OCS Task

This section covers the configuration needed on Open Chat Studio (OCS) to support Tasking.

You need an active OCS account to be able to create and assign OCS tasks to users.

Configuring OCS

Completing a Relearn task is as simple as submitting a form, but that is not the case with an OCS task, as completion of these tasks hinge on when the conversation with the bot is considered “done“. Once the conversation is done the bot need to take certain steps to tell Connect that the conversation is done. Luckily OCS supports mechanisms like Custom Actions to make this possible.

The process of configuring OCS is as follows:

  1. Create Authentication Provider so OCS authenticate to Connect

  2. Create Custom Action so the bot can talk to Connect

  3. Tell the bot to use the custom action when the conversation is done

  4. Ensure CommCare Connect channel is active for the bot

Creating an Authentication Provider

  1. Navigate to Team Settings

  2. Under Authentication Providers click Add new → OAuth (Client Credentials)

  3. Find details in 1Password by looking for “OCS OAuth credentials“

    1. Leave “Scope“ empty

    2. Leave Token Endpoint Authentication to be “HTTP Basic”

Creating a Custom Action

We’ll add a custom action that

  1. Pulls the participant data from the conversation

  2. Makes an API call to Connect on conversation completion

Before we configure the custom action it’s important to first configure an Authentication Provider, which is how the custom action will authenticate with Connect.

Steps for adding the custom action

  1. Navigate to Team Settings

  2. Under Custom Actions click Add new

    1. Fill in an appropriate name - something like “Connect Task Completion Action“

    2. Select the newly created authentication provider as the Auth setting

    3. Additional Prompt: “Extract the connectTaskId from the participant data and populate it in the API schema."

    4. Base URL: https://connect.dimagi.com

    5. API Schema:

      { "info": { "title": "API", "version": "1.0" }, "paths": { "/api/task_completed/": { "post": { "responses": { "200": { "description": "OK" } }, "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "connectTaskId": { "type": "string" } } } } } } } } }, "openapi": "3.0.0" }
    6. Make sure the “POST” is selected under Allowed operations

Now you have a custom action that is ready to be used by your bot to notify Connect when a conversation is done.

How to use the Custom Action

  1. In your bot’s pipeline find the LLM Node and click on Advanced to open all the node’s settings.

  2. Scroll down to Custom Actions and tick the custom action your created in the previous step

  3. Find the Prompt input and make sure you tell the bot to trigger the custom action when the conversation is done by using the participant data. Something like this:

...when done make the API call to mark the task completed and use the user's participant data:
{participant_data}

When is a conversation “done“?

This depends entirely on your use-case, but it is important to give the bot very clear guidelines for when a conversation can be considered “done“, as the bot will trigger the custom action when it thinks the conversation is done, marking the task as “done“ on Connect.

Create CommCare Connect Channel

The CommCare Connect channel is behind an OCS feature flag, so reach out to the OCS team to get this set up.

The last step is to make sure the bot supports conversations on the CommCare Connect channel.

  1. Navigate to Chatbots → select your bot

  2. At the top of the page select to create a new channel → CommCare Connect


Tasking

Create Task Types

A Task Type is a reusable template for a task — defined once, assigned to workers as needed.

image-20260727-100701.png

 

Steps for adding a Relearn task

  1. Navigate to Opportunity → Configure → Task Types.

  2. Click Add Task Type.

  3. For Task mode select Relearn.

  4. Select a Task Unit from the linked CommCare HQ app.

  5. Fill in:

    1. Name — shown to the worker in the Connect app.

    2. Description — what the task involves.

    3. Case Property (optional) — the HQ user case field set to 1 on assignment to unlock the task form in the app.

  6. Save.

Task Type Fields Reference

Field

Description

Field

Description

Name

Display name shown to the worker

Description

Full description of the task

Slug

Auto-filled from the HQ Task Unit ID. Do not edit manually.

Case Property

HQ user case property updated to 1 on assignment — used to make the task form visible in the app

Is Active

Only active task types can be assigned

Archived

Hidden from new assignments but historical records are preserved

Do not change the slug

The slug is set automatically when you select a Task Unit. It must match the Task Unit ID in the CommCare app exactly. Changing it will break task completion tracking.

 

Steps for adding an OCS task

  1. Navigate to Opportunity → Configure → Task Types.

  2. Click Add Task Type.

  3. For Task mode select Open Chat Studio.

  4. If your OCS account is not linked, click “Connect OCS account“, then proceed to the next step.

  5. Select the appropriate Chatbot.

  6. Fill in:

    1. Name — shown to the worker in the Connect app.

    2. Description — what the task involves.

  7. Save.


Assign Tasks to Workers

Steps

  1. Navigate to Opportunity → Tasks → Assign Task.
    https://connect-staging.dimagi.com/a/{org_slug}/opportunity/{opp_id}/assigned_tasks/
    The page is not available for redirecting from the UI, so please replace org_slug and opp_id manually in the URL.

  2. Select a Task Type.

  3. Select a Worker — only active, enrolled workers are shown.

  4. Set a Due Date (today or future).

  5. Submit.

For assigning OCS tasks you need to have your OCS account linked to Connect - if you haven’t linked your account Connect will prompt you to do so when you select an OCS task type

What Happens After Assignment

  1. Task appears in the worker's list with status Assigned.

  2. If a Case Property is set: Connect updates the worker's CommCare user case — task form becomes visible in the app on their next sync.

  3. Worker receives a push notification: "A task has been assigned to you. You must complete it before continuing Delivery activities."


How Task Completion Works

No manual action is needed.

 

For Relearn tasks this happens once a worker submits the task form:

  1. CommCare HQ receives the form and forwards it to Connect.

  2. Connect matches it to the worker's assigned task.

  3. Task status is automatically updated to Completed with the submission timestamp.

 

For OCS tasks this happens when the bot thinks the conversation is done:

  1. The OCS bot triggers the custom action

  2. The custom action reads the task ID from the participant data and prepares a payload to be sent to Connect

  3. The payload is sent to Connect and Connect marks the task from the payload as complete.

Task Status Reference

Status

What it means

Status

What it means

Assigned

Task assigned; worker has not yet submitted the form

Completed

Worker submitted the form; recorded with completion timestamp


Troubleshooting

Problem

Action

Problem

Action

Task never marked as Completed after worker submits

Verify the Task Type slug exactly matches the Task Unit ID in the HQ app (case-sensitive)

Task form not visible in worker's app

Check the Task Type has a Case Property set; verify the worker's CommCare identity is linked; try re-assigning the task