> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xpertai.cn/llms.txt
> Use this file to discover all available pages before exploring further.

# Project task and pipeline configuration reference

> Configure task and pipeline time limits, concurrency, attempts, human approvals and model budgets. Validate plugin bindings and diagnose blocked steps.

## Where to change a setting

| What you need to change | Where to set it | When it takes effect |
| - | - | - |
| Maximum duration of one implementation or review attempt | **Project configuration → Type configuration → Task execution limit (seconds)**, available when the project type declares the field | New attempts after saving, subject to the tenant ceiling |
| Elapsed time allowed between starting a pipeline and dispatching its last step | A platform-managed template’s `binding.limits.runTimeoutMinutes`, optional, in minutes | Omit for new runs with no overall deadline. When set, approval waits, nights and weekends all count |
| Which Assistant does the work, who can approve and which business parameters apply | **Project tasks → Pipeline → Configure pipeline** shows the options exposed by the template. Apps with organization-specific installation settings can also expose approver selection in app details | Save the project binding, then start work through the business entry point. The platform also checks the acting user’s authority at decision time |
| Technical attempts, concurrency, business rework rounds and native model budget | The plugin’s binding and template. A template can expose a separate model budget form | New runs use the saved binding. Eligible instances also support increasing their total token allowance |

### Change the limit for a single task

Open **Project configuration → Type configuration** on an unarchived project you can manage. For example, enter `7200` to allow up to two hours for a new implementation or review attempt. A project type can declare the standard `taskExecutionMaxDurationSeconds` field using `projectTaskConfigurationSchema()`. Enter an integer from 60 to 86,400 seconds. An omitted value inherits the type’s declared default, then the tenant default if the type has none. Read `taskExecution.effectiveMaxDurationSeconds` for the effective ceiling.

An integration can call `GET /api/xpert-project/:id/type-configuration` in the authorized organization and project context to read `schema`, `values`, `revision` and `taskExecution`. Merge changes into the returned `values` and send the complete `{ revision, values }` with `PUT` to the same path. On HTTP 409, read the current revision and reconcile the changes before submitting again. This preserves settings another project manager has just saved.

### Allow time for human approval

In platform-managed mode, the clock starts when the run is created (`run.createdAt`). If a timeout is configured, the deadline is the creation time plus `runTimeoutMinutes` minutes. The platform checks the deadline when scheduling work, reserving a new operation or validating retry and recovery. At or after the deadline it blocks these actions. Work already queued or running follows its own execution rules. The clock continues through nights, weekends and human approval waits. Moving to another node or round in the same run does not restart it. For approvals that may span days with no business deadline, omit the field. Per-task execution limits, attempt limits and approval rules still apply.

New bindings from Order Evidence (`order-evidence`) and Margin Improvement (`margin-improvement`) omit the run timeout. Both templates explicitly allow up to 10 rounds per business instance. After upgrading the platform and plugins, start with a newly generated binding to allow approvals to span days. Existing bindings and runs retain their saved settings.

For example, a run started with the old Order Evidence binding (`240` minutes) at 16:00 on Friday has used 65 hours by 09:00 on Monday in the same time zone. The approval can be recorded, but the next dispatch reports `RUN_TIME_LIMIT_EXCEEDED`. With the new default binding, those 65 hours of waiting do not exhaust a run deadline. The old Margin Improvement binding (`180` minutes) follows the same elapsed-time rule.

The standard **Configure pipeline** form exposes the template’s selectors, parameters and budget options. To change the run deadline, set `binding.limits.runTimeoutMinutes` when generating the project binding. To let project managers choose it, expose an app setting with a unit and range, read the authorized project value on the server and map it to that binding field. Setting only `binding.parameters.runTimeoutMinutes` leaves the dispatch deadline unchanged.

**What if an approval spans days and the next step reports `RUN_TIME_LIMIT_EXCEEDED`?**

1. Open **Project tasks → Pipeline → Pipeline attention** and check the reason. If approval is complete, expand its follow-up steps and inspect the next node’s execution history. The approval can be on record even when the next operation has never been dispatched.
2. Reconcile approvals, artifacts and external operation receipts before repeating work. The run uses the binding snapshot saved at startup. Refreshing, retrying or opening another round within the same run cannot extend its deadline.
3. Save a binding with the timeout omitted or with a longer limit, then start a **new run** through the app. To start again on the same instance, confirm that the old run has ended. If the template sets a round ceiling, the instance must also have a round remaining. If it is still active, a project manager can review it and decide whether to cancel. The Order Evidence demo reuses the existing instance in the same project. To demonstrate it from the beginning, create a new manufacturing order project once the plugin supplies the updated binding.

## Assign approvers to human gates

Open **Application details → Organization settings** in the target organization. Each gate has its own searchable selector for organization members, groups and the project roles allowed by the plugin. Existing installations can be updated here. For example, assign a sales lead and the engineering group to the contract gate and a different person to procurement. Margin Improvement also lets you configure plan approval and review acceptance separately. Both gates initially select project owners and managers.

The selections form a union. Any one eligible person can decide the gate once. A selected user or group member must be active in the organization and have the project privileges required by the business policy. Both example apps require owner or manager privileges. Matching multiple selections delivers one in-app action per account. Selecting two people does not require two signatures.

These assignments apply to platform-managed pipelines. Provider-managed pipelines use the provider’s own approval and notification mechanisms. The plugin references a human role through `human_gate.candidateRoleKey` and saves its organization assignment in `binding.roleBindings[roleKey].approval`. A rule can combine `userIds`, `groupIds` and `projectRoles`. When the gate opens, the platform resolves current eligible accounts and projects their in-app actions. It checks eligibility again when a decision is submitted. The plugin can narrow the eligible project roles with `decisionRecipientRoles`. Its business policy still validates the current proposal and the decision itself.

**The gate is ready, but my account has no action.** Open **Project tasks → Pipeline → Pipeline attention**. If there are no eligible approvers, check the assignment in this run’s binding, active organization membership, group membership and project role. Membership corrections take effect on a subsequent notification sync. Changes to organization settings apply to newly generated bindings. For historical Order Evidence runs with no declared notification audience, the originally authorized user can still act from pipeline attention. To verify personal delivery in Order Evidence, start the pipeline in a new order project so the app generates a new binding. Calling the start tool again in the original project reuses the existing order instance.

## Platform-managed pipeline fields

Paths below are relative to `ProjectPipelineConfiguration`. The root object is `{ schemaVersion: 1, template, binding }`. Platform-managed bindings require `binding.limits` with integer values for concurrency and technical attempts per node.

| Field | Value or constraint | Runtime meaning |
| - | - | - |
| `binding.limits.runTimeoutMinutes` | Optional, in minutes. Supply a positive safe integer up to `Number.MAX_SAFE_INTEGER`. Omit for no overall deadline. Zero, fractions and `null` are invalid | Measured continuously from run creation. New dispatch stops at the deadline. Dispatched tasks remain subject to their own execution limits |
| `binding.limits.maxConcurrentExecutions` | 1–100 | Limits concurrent dispatch by the coordinator. A dependent node still waits for its prerequisites |
| `binding.limits.maxTechnicalAttemptsPerNode` | 1–20, counting the first attempt | Bounds technical attempts per node. Normal retry also requires a retryable operation, confirmed failure and time remaining |
| `template.roundPolicy.maxRounds` | Optional integer from 1 to 100. Omit for unlimited business rounds | Counts rounds across all runs of one instance, including the first round at launch. At the ceiling, starting another round or a new run on that instance returns `ROUND_LIMIT_EXCEEDED` |
| `binding.roleBindings`, `binding.executorBindings` | Roles must satisfy `allowedKinds`. A work node’s `executorSlot` must bind the role for its lane | A `human_gate` node’s `candidateRoleKey` must resolve to a `human` binding. Resolve approvers for the current organization and authorize the actual decision |
| `binding.parameters` | JSON object keyed by parameter name | Supply every key referenced by a node’s `inputBindings` with source `parameter` |
| `binding.limits.nativeModelBudget` | Optional. Supply `maxCalls`, `maxTokens` and `reservationTokens` together | Controls admission of host-native model calls. Declare `hostRequirements.features['pipeline.native_model_budget'] = 1` in the template |

Platform-managed templates still require `template.roundPolicy`. Keep the entry node, rework policy and terminal outcomes, and omit only `maxRounds` to allow the same instance to continue past 100 rounds. Rework still needs a new business input version. Retrying the same request reuses its existing round. To remove the ceiling from a published template, publish a new template version. In provider-managed mode, the business engine controls rounds.

This binding allows two concurrent dispatches and three attempts per node, with no overall run deadline. If approval and subsequent dispatch must take place within 45 days, add `"runTimeoutMinutes": 64800` to the same object.

```json theme={null}
{
  "maxConcurrentExecutions": 2,
  "maxTechnicalAttemptsPerNode": 3
}
```

For model budgets, the integer ranges are 1–1,000,000 for `maxCalls`, 1–1,000,000,000,000 for `maxTokens`, and 1–1,000,000,000 for `reservationTokens`. The reservation cannot exceed the total token ceiling. A catalog declaration may set top-level `nativeModelBudgetPolicy.maxTokensDefaultSource` to `configuration` or `host`, and use `maximum` to bound the options for new configurations. Pass resolved values to the configure command. An increase for an existing instance specifies the **new total token ceiling**. Any explicitly configured run deadline still applies.

Operators can use `XPERT_TASK_EXECUTION_MAX_DURATION_SECONDS` to set the host’s initial task-duration default (43,200 seconds by default, range 60–86,400) and `XPERT_PIPELINE_DEFAULT_MAX_TOKENS` for the token default used by templates that select `host` (100,000,000 by default, range 10,000–1,000,000,000,000). These are bootstrap defaults. Persisted tenant policies and bindings retain their own values.

## Save and start a binding from a plugin

Select the scheduling mode with `template.executionAuthority`.

* **Platform-managed (`platform`)**. Set concurrency, attempts and the optional overall deadline in the project’s `binding.limits`. The platform enforces these settings.
* **Provider-managed (`provider`)**. Bind every template role and omit `binding.limits`, `binding.executorBindings` and `binding.triggers`. If the provider supports timeouts, use its documented settings in `binding.providerConfiguration` or in the business engine. The provider defines when its clock starts, whether approval waits count and how to recover after expiry. If work stalls after approval, inspect the provider’s state and receipts in its business workbench and follow its recovery procedure.

The example saves a platform-managed binding. Supply the project manager’s trusted context, the resolved configuration and a stable UUID for this save command. Pass `64800` as the final argument for a 45-day limit on new runs. Omit it to clear the new binding’s deadline while preserving concurrency, attempts and any existing budget.

```ts theme={null}
import {
  projectPipelineConfigurationSchema,
  type ProjectPipelineConfiguration
} from '@xpert-ai/contracts'
import {
  ProjectPipelineCommandsRuntimeCapability,
  ProjectPipelineConfigurationRuntimeCapability,
  type ProjectPipelineContext,
  type RuntimeCapabilityRegistry
} from '@xpert-ai/plugin-sdk'

export async function savePipelineBinding(
  runtime: RuntimeCapabilityRegistry,
  context: ProjectPipelineContext,
  base: ProjectPipelineConfiguration,
  requestId: string,
  runTimeoutMinutes?: number
) {
  if (base.template.executionAuthority !== 'platform' || !base.binding.limits) {
    throw new Error('This binding requires a platform-managed template')
  }
  const limits = { ...base.binding.limits }
  if (runTimeoutMinutes === undefined) delete limits.runTimeoutMinutes
  else limits.runTimeoutMinutes = runTimeoutMinutes
  const configuration = projectPipelineConfigurationSchema.parse({
    ...base,
    binding: {
      ...base.binding,
      limits
    }
  })
  const checks = runtime.require(ProjectPipelineConfigurationRuntimeCapability)
  const result = await checks.check(context, configuration)
  if (!result.valid) {
    throw new Error(JSON.stringify(result.issues))
  }
  const commands = runtime.require(ProjectPipelineCommandsRuntimeCapability)
  return commands.configure(context, { requestId, configuration })
}
```

1. Match `binding.templateRef` to `${template.key}@${template.version}`. Publish a new template version when the graph or template policy changes. Binding-only changes can reference the same template version.
2. `check` validates configuration and registered extension dependencies. Even with `valid` set to true, `runtimeReadiness` is `not_checked`. Verify the actual executors, approvers and data sources in the target organization during acceptance.
3. `configure` returns a `bindingId` and a `revision`. Reuse the `requestId` to retry the same save. Allocate a new one for changed configuration.
4. When a user starts work from the business entry point, call `commands.start(context, { bindingId, objectKey, triggerKey, title })`. Persist the business object and trigger keys and reuse them on retries of that trigger. A genuinely new run for the same business object needs a new business trigger key. Use the host-authorized project context and keep tenant or organization accounts out of portable templates.

### Common diagnostic codes

| Code | What to check first |
| - | - |
| `RUN_TIME_LIMIT_EXCEEDED` | Elapsed time from run creation to attempted dispatch, compared with the minutes in that run’s binding snapshot |
| `ROUND_LIMIT_EXCEEDED` | Compare the template’s `roundPolicy.maxRounds` with the total rounds across this instance’s runs. If the business process needs more rounds, use a new template version through the app |
| `ATTEMPT_LIMIT_EXCEEDED` / `OPERATION_RETRY_UNSAFE` | Existing attempts, whether the latest receipt confirms failure, and whether the operation declares retry support. Inspect execution evidence when the outcome is unknown |
| `MODEL_BUDGET_EXCEEDED` | Instance model usage and which quota was exhausted. Raise the total token ceiling only if tokens are the constraint and the instance supports the increase |
| `EXECUTION_LIMITS_REQUIRED` / `PROVIDER_CONTROLS_EXECUTION` | Platform-managed bindings require concurrency and attempts per node in `limits`. Provider-managed bindings must omit `limits` entirely |
| `HUMAN_BINDING_REQUIRED` / `PARAMETER_NOT_FOUND` | Follow the field path in the validation result to supply the missing human role or referenced parameter |

See the [project type configuration contract](https://github.com/xpert-ai/xpert/blob/main/packages/contracts/src/ai/project-type-configuration.model.ts), [pipeline configuration schema](https://github.com/xpert-ai/xpert/blob/main/packages/contracts/src/ai/project-pipeline/configuration.schema.ts) and [runtime capability interfaces](https://github.com/xpert-ai/xpert/blob/main/packages/plugin-sdk/src/lib/project-pipeline/capability.ts).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.