Skip to main content

Calculate flow

Enterprise Only
This API is available exclusively in Countly Enterprise.

Endpoint

/i/flows/calculate

Overview

Starts asynchronous calculation for a flow schema.

Authentication

Countly API supports three authentication methods:

  1. API key query parameter: api_key=YOUR_API_KEY
  2. Auth token query parameter: auth_token=YOUR_AUTH_TOKEN
  3. Auth token header: countly-token: YOUR_AUTH_TOKEN

Permissions

Requires flows Create permission for this endpoint.

Request Parameters

ParameterTypeRequiredDescription
app_idStringYesTarget app ID.
_idStringYesFlow ID to calculate.
api_keyStringConditionalRequired if auth_token is not provided.
auth_tokenStringConditionalRequired if api_key is not provided.

Configuration Impact

SettingDefaultAffectsUser-visible impact
flows.nodesCn10Maximum nodes per step during calculation.Higher values can return wider flow branches per level.
flows.maxDepth20Maximum step depth during calculation.Higher values can return longer flow paths.

Other flows settings (regenerateInterval, skipAutoFlows) do not change manual /i/flows/calculate request behavior.

Response

Success Response

{
"result": "Flow calculation started"
}

Response Fields

FieldTypeDescription
resultStringStart confirmation.

Error Responses

  • 400
{
"result": "Missing request parameter(id of the flow):_id"
}
  • 400
{
"result": "Flow not found"
}
  • 400
{
"result": "Flow is already being calculated"
}
  • 400
{
"result": "Flow is disabled, enable it to run calculations."
}
  • 400
{
"result": "Data base error. Pleas check logs"
}

Behavior/Processing

  • Loads schema by _id and app_id.
  • Blocks when already calculating or disabled.
  • Normalizes period formatting.
  • Calls background flow calculation and returns immediately.

Database Collections

CollectionUsed forData touched by this endpoint
countly.flow_schemasEndpoint data sourceStores endpoint-related records this endpoint reads or modifies.
countly.flow_dataEndpoint data sourceStores endpoint-related records this endpoint reads or modifies.

Examples

/i/flows/calculate?
app_id=64f5c0d8f4f7ac0012ab3456&
_id=64f5c0d8f4f7ac0012ab3456_67bd31c92e7f0b0012ab4567


Last Updated

2026-02-16