Skip to content

Function Re-run

Overview

The function re-run feature enables you to re-execute compute functions using the exact state from a previous run. This is useful for:

  • Debugging: Reproduce issues with the exact same parameters
  • Recovery: Retry failed executions without manual parameter reconstruction
  • Testing: Validate fixes by re-running with original data
  • Audit: Track lineage and history of function executions

Re-running a Function

Endpoint

POST https://api.centrali.io/workspace/{workspace}/api/v1/function-runs/{runId}/rerun

Request Body

All fields are optional:

{
  "useLatestCode": false,
  "reason": "Retrying after bug fix",
  "overrideParams": {
    "customParam": "new value"
  }
}
Field Type Default Description
useLatestCode boolean false Use current function code instead of original
reason string Reason for re-running (stored for audit)
overrideParams object Override specific parameters while keeping the rest from the original run

Example

curl -X POST \
  'https://api.centrali.io/workspace/my-workspace/api/v1/function-runs/550e8400-e29b-41d4-a716-446655440000/rerun' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
    "reason": "Testing fix for edge case",
    "overrideParams": {
      "debugMode": true
    }
  }'

Response

{
  "jobId": "job-uuid-here",
  "message": "Re-run successfully queued. Original run run-uuid has been re-executed."
}

Re-run History

View all re-runs that originated from a specific run.

Endpoint

GET https://api.centrali.io/workspace/{workspace}/api/v1/function-runs/{runId}/rerun-history

Example

curl -X GET \
  'https://api.centrali.io/workspace/my-workspace/api/v1/function-runs/550e8400-e29b-41d4-a716-446655440000/rerun-history' \
  -H 'Authorization: Bearer YOUR_TOKEN'

Response

{
  "originalRunId": "550e8400-e29b-41d4-a716-446655440000",
  "rerunCount": 3,
  "reruns": [
    {
      "id": "660e9500-f30c-52e5-b827-557766550001",
      "originalRunId": "550e8400-e29b-41d4-a716-446655440000",
      "isRerun": true,
      "rerunBy": "user-uuid",
      "rerunReason": "Testing fix",
      "status": "completed",
      "createdAt": "2025-10-10T14:30:00Z"
    }
  ]
}

Parameter Overrides

You can override specific parameters while keeping the rest from the original run. Overridden values are merged with the original parameters.

Original Parameters:

{
  "apiKey": "encrypted-key",
  "mode": "production",
  "timeout": 30
}

Re-run Request:

{
  "overrideParams": {
    "mode": "debug",
    "timeout": 60
  }
}

Effective Parameters (merged):

{
  "apiKey": "encrypted-key",
  "mode": "debug",
  "timeout": 60
}

Supported Trigger Types

Re-run works for all trigger types:

Trigger Type Supported Notes
On-demand Yes Re-executes with stored parameters
Event-driven Yes Re-executes with stored event data
Scheduled Yes Re-executes as if the schedule triggered it
HTTP Yes Re-executes with stored webhook payload

Note

Orchestration-initiated runs must be rerun through the orchestration API, not this endpoint.

Lineage Tracking

Each re-run maintains a link back to the original run, creating a traceable lineage:

Original Run (run-1)
├── rerunCount: 2
└── isRerun: false

Re-run 1 (run-2)
├── isRerun: true
├── originalRunId: run-1
└── rerunBy: user-123

Re-run 2 (run-3)
├── isRerun: true
├── originalRunId: run-1
└── rerunBy: user-456

All re-runs point back to the original run (not to each other), making it easy to trace the full execution history.

Permissions

Re-running a function requires execute permission on the function-triggers resource.

Error Scenarios

Error HTTP Code Message
Invalid run ID 400 "Invalid run ID."
Run not found 400 "Original run not found."
Wrong workspace 400 "Run does not belong to this workspace."
No parameters stored 400 "Original run has no parameters stored."
Decryption failed 400 "Failed to decrypt original run parameters."
Trigger deleted 400 "Original trigger not found. It may have been deleted."
Function deleted 400 "Function not found for trigger: {triggerId}"