Last reviewed: 2026-11-20

Budget a CometAPI batch with two separate ledgers: one for Step Functions executions and one for provider requests and usage. Standard workflows charge by state transitions, including retries; Express workflows charge by workflow requests, duration and memory. CometAPI cost follows the billable units for each provider attempt. Do not use a Step Functions execution count as a proxy for model requests: one workflow can make several requests, and retry paths can add both kinds of cost.

The workflow type also changes the recovery contract. Standard state execution is exactly once unless the state machine configures Retry. Asynchronous Express execution is at least once; synchronous Express execution is at most once. These guarantees do not make a second application submission an idempotent provider request. A Distributed Map requires a Standard parent, with Standard or Express child workflows. Estimate the two bills independently, then test the map, retry and failure paths before increasing the batch size.

Keep workflow charges and provider charges in separate ledgers

The AWS Step Functions pricing page describes different meters for Standard and Express. Standard is charged by state transitions, with retries included. Express is charged by workflow requests and execution duration, with memory also used in the calculation. Express duration rounds up to 100-millisecond increments and memory is billed in 64-MB chunks. The account’s region and applicable pricing terms determine the rates, so use the current price table for the deployment region rather than copying a rate from an old estimate.

LedgerCount before approvalReconcile after the run
Standard workflowExecuted state transitions, including retries and Map-related workExecution history, including parent and child executions
Express workflowStarts, rounded execution duration and memory tierWorkflow telemetry for the same input and concurrency shape
CometAPIEvery provider attempt and its billable request unitsReturned usage for each completed response and the current route price
Other AWS servicesLambda, storage, logs, data transfer and any other invoked servicesTheir own service usage records and region-specific rates

A workflow request and a model request are different units. One Express start might call CometAPI once, several times, or not at all if validation stops the path. Track those counts separately. AWS also notes that services used by the workflow and data transfer may add charges beyond Step Functions itself.

For provider-side planning, start with the request classes, maximum attempts, token limits and model route. The site’s CometAPI backfill budget workflow covers the separate approval and stop-condition record for replayed work. This guide adds the workflow-engine ledger so orchestration overhead does not disappear inside model cost.

Use the provider’s current rate for the approved route and multiply it by the maximum billable units allowed across all attempts. For token-priced requests, that means a conservative input and output token allowance per attempt, multiplied by the maximum number of attempts, then priced using the current schedule. Do not assume every failed or timed-out call was free: if it reached the provider, preserve the attempt as billable or unresolved until evidence settles it.

Count Map and retry paths from a frozen batch

Before estimating, freeze a small batch manifest: item count, parent and child state-machine versions and types, any Express invocation mode, model route, maximum CometAPI calls per item, per-request token limits, retry settings, and the permitted recovery path. The state-machine type cannot be changed after creation, so record the decision before deploying it.

The Distributed Map reference requires the containing parent workflow to be Standard. The Map’s ItemProcessor.ProcessorConfig.ExecutionType selects Standard or Express children; an Express parent cannot host a Distributed Map. Each iteration runs as a child workflow execution with its own history. The pricing page’s example counts one state transition per iteration, with child workflow charges accounted for separately. Count the Standard parent and iteration transitions first, then add either Standard child transition charges or Express child request, duration and memory charges.

A Retry on the Distributed Map state applies to all the child workflow executions it started and creates a new Map Run. Include the restarted iterations and affected child work in the estimate rather than counting only one failed item.

A useful worksheet is:

  • Standard parent and iteration transitions per job = parent-path transitions + Map iteration transitions + applicable parent retry and recovery transitions.
  • With Standard children, add every executed child transition, including child retry and recovery paths, to the Standard total.
  • With Express children, price child starts, rounded execution duration and memory separately; add those charges to the Standard parent and iteration charges.
  • Monthly Standard transitions = jobs per month multiplied by all Standard transitions per job.
  • Provider attempts = planned requests + provider retries + separately approved repair or fallback requests.

For example, suppose a Standard parent uses a Distributed Map with Standard children for 1,200 items. A bounded test shows five Standard child transitions per item; the pricing example contributes one Map iteration transition per item; the parent path uses four transitions; and the approved retry envelope adds 36 transitions. The synthetic total is 1,200 + (1,200 * 5) + 4 + 36 = 7,240 transitions per job. At 20 jobs in a month, that is 144,800 transitions before applying current regional rates or any account-specific allowance. These counts are illustrative, not AWS defaults. Replace them with the measured state paths and configured retry limits. If the measured total already includes retries, do not add them a second time.

Then price the provider side independently. If each item normally sends one model request, 1,200 items create 1,200 planned requests; if 36 items take a provider retry, count those extra attempts in the provider ledger too. A single workflow retry can increase Step Functions transitions and provider attempts, but they do not necessarily increase by the same amount. Capture the request count and transition count as separate outputs.

Choose Standard or Express for the Map’s children

Fix the Distributed Map parent as Standard before comparing child prices. The workflow-type comparison should drive the child choice alongside the estimated price. Standard workflows support long-running, durable and auditable execution, with a maximum duration of one year. Their exactly-once model applies to state execution unless Retry behavior is configured. Express workflows have a five-minute maximum. The comparison distinguishes asynchronous Express’s at-least-once execution from synchronous Express’s at-most-once execution. Record the actual invocation mode for any Express execution you estimate; ExecutionType selects the child’s workflow type, not a synchronous invocation guarantee. AWS makes workflow type immutable after creation.

That distinction matters when a generation call succeeds remotely but the worker loses the response before saving the result. A configured retry or a new caller submission can send another provider request; asynchronous Express can also repeat workflow execution. Synchronous Express’s at-most-once guarantee does not guarantee successful completion or make a later caller resubmission idempotent. The workflow’s execution guarantee does not prove whether a remote request was accepted or billed. Keep a durable attempt record keyed by the application job and item identity, record dispatch and result state, and route ambiguous outcomes to reconciliation instead of issuing a fresh request automatically. Do not assume CometAPI supports an idempotency key unless the current endpoint contract says so.

For Express children, count child starts separately from model attempts, then price duration and memory for the same workload shape. Retain the separate Standard parent and iteration charges in that estimate. A low orchestration estimate does not make a path appropriate if repeated execution or explicit retries could repeat a paid side effect. For Standard children, model explicit Retry paths and recovery states; a broad Map retry can consume far more transitions and provider calls than the happy path. The expected cost should include the failure path that the deployed policy actually permits.

Verify both estimates before enabling the route

Run a bounded staging execution with the same state graph and a fake provider adapter that records attempted calls without sending prompts to CometAPI. Exercise the normal path, one configured retry, one Map failure, and the maximum recovery path. Compare Standard execution histories and Express logs or metrics with the worksheet. An immediate fake response validates state paths and attempt counts; its duration does not estimate a remote model call.

Before approving Express costs, write down representative or conservative assumptions for model-response delays, configured timeouts, retry backoff, worker overhead, and input, intermediate and output payload sizes at the approved concurrency. Configure the stub to reproduce those conditions, including slow and retry paths, or use separately budgeted representative route measurements. AWS measures Express duration from workflow start until termination, so an immediate stub can understate the elapsed-time meter. Workflow definition size, Map or Parallel use and payload sizes also affect memory. Record the memory tier for the modeled workload rather than treating a successful path test as evidence of production memory usage. Reconcile a bounded representative route measurement’s starts, duration and memory with those assumptions before scaling.

Next, calculate the provider allowance from the approved model route, maximum input and output units, and total permitted attempts. CometAPI’s Create a chat completion reference documents response usage fields and their billing role. Record returned usage per attempt alongside the request identity; do not store prompts or full outputs in a cost dashboard. If the route streams, confirm the client’s usage-capture behavior against the current reference before treating a missing final usage record as zero.

Keep a low-sensitivity reconciliation row for each job with the batch ID, workflow and execution identifiers, item count, model route, planned calls, attempted calls, transition count, returned usage totals and unresolved attempts. For Express children, also retain starts, duration and memory tier. Keep expected values and actual observations separate. The site’s CometAPI usage metrics guide explains how to bound the label set when exporting those counters to Prometheus; labels should not contain prompts, credentials or per-request identifiers.

Before the first live batch, set an owner for the workflow budget and a stop condition for new work. When the limit is reached, stop admitting new items and inspect already-running child executions; cancellation does not reverse a provider request that has already been sent. Increase the item count only after the staging run reconciles both ledgers and the configured failure path stays inside its approved allowance. For one bounded route check, Start with CometAPI , then reconcile its response usage before scaling the Map.

Sources checked

These official technical references were fetched on 2026-11-19 UTC. The AWS pricing page showed a November 17, 2026 update when fetched. No region-specific AWS or CometAPI rates are asserted here; confirm the active price schedule for the account and route before approval.