New Billing - per action credit consumption (#4398)

This commit is contained in:
Marc Kelechava
2026-01-05 17:43:05 -08:00
committed by GitHub
parent c5251e7115
commit 4adadee82a
2 changed files with 26 additions and 0 deletions

View File

@@ -68,6 +68,7 @@ WORKFLOW_RUN_BLOCK_PREFIX = "wrb"
WORKFLOW_RUN_PREFIX = "wr"
WORKFLOW_SCRIPT_PREFIX = "ws"
WORKFLOW_TEMPLATE_PREFIX = "wt"
ORGANIZATION_BILLING_PREFIX = "ob"
def generate_workflow_id() -> str:
@@ -260,6 +261,11 @@ def generate_script_block_id() -> str:
return f"{SCRIPT_BLOCK_PREFIX}_{int_id}"
def generate_billing_id() -> str:
int_id = generate_id()
return f"{ORGANIZATION_BILLING_PREFIX}_{int_id}"
############# Helper functions below ##############
def generate_id() -> int:
"""