Skip to main content

Calculate flow

Enterprise

This endpoint is part of Countly Enterprise. To get access, contact sales or compare versions. Existing customers can reach the support portal with questions.

Endpoint

/i/flows/calculate

Overview

Starts asynchronous calculation for a flow schema.

Authentication

Pass api_key or auth_token as a query parameter, or send countly-token as a header. See Authentication.

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.

Examples

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

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

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

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.

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.