Skip to main content
GET
Forecast a workflow run's cost
The reference panel describes the current v3 operation. The notes below describe its v2 compatibility API. Follow the v3 request schema for current calls: v3 can move identifiers from the body or query into the URL. Keep the v2 method, path, and payload together when using the compatibility API.

v2 compatibility notes

GET /api/v2/workflows/getRunCostForecast?id=<workflowId> returns {workflowId, forecast}: the expected cost of the next run of the workflow’s active version, from up to 200 completed runs of it in the last 30 days.

Authentication

External App credential or platform API key, or a Personal key. Requires permission workflows:read at the workflow’s home: a workflow that is malformed, unknown, trashed, unhomed or outside the caller’s reach answers 404. A Personal key acts as its owner, narrowed by its scopes.

Response

forecast has sampleSize, p50Cents, p95Cents, maxCents, meanCents and lookbackDays. It is null with fewer than five such runs or no active version. Aggregates only: no run is named.

Authorizations

Authorization
string
header
required

An External App: the JWT it obtains from POST /oauth/token with OAuth2 client_credentials. Pass as Authorization: Bearer <jwt>. An app's static companion key also authenticates as the app, but is deprecated and is not protected by Idempotency-Key.

Path Parameters

workflowId
string
required

The workflow.

Minimum string length: 1

Response

Success

data
object
required
meta
object
required