Skip to content

本页为英文技术参考;字段、编号与支持状态直接来自同一契约源。中文学习路线见 开发文档。

Workflows ​

Compose registered actions and predicates into bounded, observable work. Workflow definitions describe ordering, branches, retries and recovery; they do not bypass each node’s permissions.

Contract: nexa.workflows/100. API index.

Typical sequence ​

Register and validate the definition before activation. Start with typed inputs, then read or watch the operation. Persistent recovery requires the saved revision, unchanged definition and compatible inputs.

Behavior and limits ​

Resume known progress only. OUTCOME_UNKNOWN records an effect whose result cannot be established; it is not a failed step that is automatically safe to retry.

The recorded Host maps 12 of 12 operations in this group. A mapping is subject to permission, phase, scope, platform and business preconditions. Host snapshot identifies the source revision; negotiate against the actual installed Host.

Operations ​

Register · Validate · Preview · Start · Read · Watch · Cancel · ListRuns · Resume · RetryStep · ExplainPlan · ReadRunTrace

Register ​

WorkflowDefinition → RegistrationRef

PropertyContract
Local SDK method ID1
KindRegistration
Permissionnexa.workflows.write
Legal phasesInitialize
IdempotencyRequiredKey
Host statusMapped in recorded snapshot

Request fields

FieldTypeMeaning
IdQualifiedIdIdentity in this model’s domain. Use the identity issued or declared for this object, not a display name or filesystem path.
InputSchemaRefStructured SchemaRef value; follow its linked field contract.
OutputSchemaRefStructured SchemaRef value; follow its linked field contract.
NodesWorkflowNode[]Structured WorkflowNode value; follow its linked field contract. A bounded collection; do not assume an unbounded result or unspecified ordering.
DefinitionDigeststringDomain value named by this field; additional accepted values and bounds are determined by the operation and Host policy.
PersistentboolDomain value named by this field; additional accepted values and bounds are determined by the operation and Host policy.
ConcurrencyConcurrencyPolicyDeclared execution policy. A provider family may reject enum members whose semantics it does not implement.
MaximumDepthlongDomain value named by this field; additional accepted values and bounds are determined by the operation and Host policy.
MaximumWorklongDomain value named by this field; additional accepted values and bounds are determined by the operation and Host policy.

Successful result

Retain the registration identity for the permitted update/release operation. Staged registrations become visible only at group activation.

Failure and retry

Unavailable capability, denied permission, wrong phase, malformed schema or foreign ownership fails the call. Supply a key for the intended effect and retain that key and inputs while resolving an uncertain reply. Do not retry with changed inputs under the same key. Preserve structured errors; see recovery guidance.

C binding (call fragment; the caller supplies the encoded request and buffers):

c
nx_Workflows_Register(&reply, request, &options);

The next resume receives the reply. Check nx_reply_success before nx_Workflows_Register_result. See the complete continuation example and Wasm ownership rules. This fragment is not a standalone guest.

Validate ​

WorkflowDefinition → ValidationReport

PropertyContract
Local SDK method ID2
KindQuery
Permissionnexa.workflows.read
Legal phasesInitialize, PostInitialize, Checkup, Finalize, Active
IdempotencyReadOnly
Host statusMapped in recorded snapshot

Request fields

FieldTypeMeaning
IdQualifiedIdIdentity in this model’s domain. Use the identity issued or declared for this object, not a display name or filesystem path.
InputSchemaRefStructured SchemaRef value; follow its linked field contract.
OutputSchemaRefStructured SchemaRef value; follow its linked field contract.
NodesWorkflowNode[]Structured WorkflowNode value; follow its linked field contract. A bounded collection; do not assume an unbounded result or unspecified ordering.
DefinitionDigeststringDomain value named by this field; additional accepted values and bounds are determined by the operation and Host policy.
PersistentboolDomain value named by this field; additional accepted values and bounds are determined by the operation and Host policy.
ConcurrencyConcurrencyPolicyDeclared execution policy. A provider family may reject enum members whose semantics it does not implement.
MaximumDepthlongDomain value named by this field; additional accepted values and bounds are determined by the operation and Host policy.
MaximumWorklongDomain value named by this field; additional accepted values and bounds are determined by the operation and Host policy.

Successful result

Decode the exact output model after Success. Preserve its identities, revision and schema metadata for subsequent domain operations.

Failure and retry

Unavailable capability, denied permission, wrong phase, malformed schema or foreign ownership fails the call. A read-only classification does not bypass budgets or guarantee a failed request can be retried indefinitely. Preserve structured errors; see recovery guidance.

C binding (call fragment; the caller supplies the encoded request and buffers):

c
nx_Workflows_Validate(&reply, request, &options);

The next resume receives the reply. Check nx_reply_success before nx_Workflows_Validate_result. See the complete continuation example and Wasm ownership rules. This fragment is not a standalone guest.

Preview ​

WorkflowRequest → MutationPlan

PropertyContract
Local SDK method ID3
KindQuery
Permissionnexa.workflows.read
Legal phasesInitialize, PostInitialize, Checkup, Finalize, Active
IdempotencyReadOnly
Host statusMapped in recorded snapshot

Request fields

FieldTypeMeaning
WorkflowQualifiedIdIdentity or revision in this model’s domain; preserve ownership and exact spelling.
InputsAbiValueTyped input value encoded under the declared input schema.
DefinitionDigeststringDomain value named by this field; additional accepted values and bounds are determined by the operation and Host policy.

Successful result

Retain the exact plan ID and revision, review its bound inputs and confirmation requirement, then use the corresponding commit operation.

Failure and retry

Unavailable capability, denied permission, wrong phase, malformed schema or foreign ownership fails the call. A read-only classification does not bypass budgets or guarantee a failed request can be retried indefinitely. Preserve structured errors; see recovery guidance.

C binding (call fragment; the caller supplies the encoded request and buffers):

c
nx_Workflows_Preview(&reply, request, &options);

The next resume receives the reply. Check nx_reply_success before nx_Workflows_Preview_result. See the complete continuation example and Wasm ownership rules. This fragment is not a standalone guest.

Start ​

WorkflowRequest → OperationRef

PropertyContract
Local SDK method ID4
KindOperation
Permissionnexa.workflows.write
Legal phasesActive
IdempotencyRequiredKey
Host statusMapped in recorded snapshot

Request fields

FieldTypeMeaning
WorkflowQualifiedIdIdentity or revision in this model’s domain; preserve ownership and exact spelling.
InputsAbiValueTyped input value encoded under the declared input schema.
DefinitionDigeststringDomain value named by this field; additional accepted values and bounds are determined by the operation and Host policy.

Successful result

Work has been admitted. Read or watch the owned operation through Tasks to establish its terminal result; admission is not completion.

Failure and retry

Unavailable capability, denied permission, wrong phase, malformed schema or foreign ownership fails the call. Supply a key for the intended effect and retain that key and inputs while resolving an uncertain reply. Do not retry with changed inputs under the same key. Re-read after revision conflicts; cancellation does not prove rollback. Preserve structured errors; see recovery guidance.

C binding (call fragment; the caller supplies the encoded request and buffers):

c
nx_Workflows_Start(&reply, request, &options);

The next resume receives the reply. Check nx_reply_success before nx_Workflows_Start_result. See the complete continuation example and Wasm ownership rules. This fragment is not a standalone guest.

Read ​

EntityRequest → OperationRecord

PropertyContract
Local SDK method ID5
KindQuery
Permissionnexa.workflows.read
Legal phasesInitialize, PostInitialize, Checkup, Finalize, Active
IdempotencyReadOnly
Host statusMapped in recorded snapshot

Request fields

FieldTypeMeaning
IdEntityIdIdentity in this model’s domain. Use the identity issued or declared for this object, not a display name or filesystem path.

Successful result

Decode the exact output model after Success. Preserve its identities, revision and schema metadata for subsequent domain operations.

Failure and retry

Unavailable capability, denied permission, wrong phase, malformed schema or foreign ownership fails the call. A read-only classification does not bypass budgets or guarantee a failed request can be retried indefinitely. Preserve structured errors; see recovery guidance.

C binding (call fragment; the caller supplies the encoded request and buffers):

c
nx_Workflows_Read(&reply, request, &options);

The next resume receives the reply. Check nx_reply_success before nx_Workflows_Read_result. See the complete continuation example and Wasm ownership rules. This fragment is not a standalone guest.

Watch ​

WatchRequest → SubscriptionRef

PropertyContract
Local SDK method ID6
KindSubscription
Permissionnexa.workflows.read
Legal phasesInitialize, PostInitialize, Checkup, Finalize, Active
IdempotencyReadOnly
Host statusMapped in recorded snapshot

Request fields

FieldTypeMeaning
TargetEntityIdIdentity or revision in this model’s domain; preserve ownership and exact spelling.
Cursorstring?Opaque continuation or observation cursor. Reuse only in the issuing query/scope; absence and invalidity are different. Nullable; omission is distinct from an empty value. No implicit default is promised by this type.
SchemaSchemaRefExact schema identity, version and fingerprint used to validate Value.

Successful result

Retain the subscription identity, consume bounded batches or callbacks as specified, handle gaps, and release it when no longer needed.

Failure and retry

Unavailable capability, denied permission, wrong phase, malformed schema or foreign ownership fails the call. A read-only classification does not bypass budgets or guarantee a failed request can be retried indefinitely. Preserve structured errors; see recovery guidance.

C binding (call fragment; the caller supplies the encoded request and buffers):

c
nx_Workflows_Watch(&reply, request, &options);

The next resume receives the reply. Check nx_reply_success before nx_Workflows_Watch_result. See the complete continuation example and Wasm ownership rules. This fragment is not a standalone guest.

Cancel ​

OperationRequest → OperationRef

PropertyContract
Local SDK method ID7
KindMutation
Permissionnexa.workflows.write
Legal phasesActive
IdempotencyRequiredKey
Host statusMapped in recorded snapshot

Request fields

FieldTypeMeaning
OperationEntityIdIdentity or revision in this model’s domain; preserve ownership and exact spelling.

Successful result

Work has been admitted. Read or watch the owned operation through Tasks to establish its terminal result; admission is not completion.

Failure and retry

Unavailable capability, denied permission, wrong phase, malformed schema or foreign ownership fails the call. Supply a key for the intended effect and retain that key and inputs while resolving an uncertain reply. Do not retry with changed inputs under the same key. Re-read after revision conflicts; cancellation does not prove rollback. Preserve structured errors; see recovery guidance.

C binding (call fragment; the caller supplies the encoded request and buffers):

c
nx_Workflows_Cancel(&reply, request, &options);

The next resume receives the reply. Check nx_reply_success before nx_Workflows_Cancel_result. See the complete continuation example and Wasm ownership rules. This fragment is not a standalone guest.

ListRuns ​

PageRequest → Page<OperationRecord> (wrapper, item)

PropertyContract
Local SDK method ID8
KindQuery
Permissionnexa.workflows.read
Legal phasesInitialize, PostInitialize, Checkup, Finalize, Active
IdempotencyReadOnly
Host statusMapped in recorded snapshot

Request fields

FieldTypeMeaning
Cursorstring?Opaque continuation or observation cursor. Reuse only in the issuing query/scope; absence and invalidity are different. Nullable; omission is distinct from an empty value. No implicit default is promised by this type.
LimitlongRequested bound on returned items. The Host may impose a smaller domain-specific limit.

Successful result

Read Items and continue with NextCursor while preserving the original query. An absent cursor ends the sequence; an invalid cursor is an error.

Failure and retry

Unavailable capability, denied permission, wrong phase, malformed schema or foreign ownership fails the call. A read-only classification does not bypass budgets or guarantee a failed request can be retried indefinitely. Preserve structured errors; see recovery guidance.

C binding (call fragment; the caller supplies the encoded request and buffers):

c
nx_Workflows_ListRuns(&reply, request, &options);

The next resume receives the reply. Check nx_reply_success before nx_Workflows_ListRuns_result. See the complete continuation example and Wasm ownership rules. This fragment is not a standalone guest.

Resume ​

WorkflowRunRequest → OperationRef

PropertyContract
Local SDK method ID9
KindOperation
Permissionnexa.workflows.write
Legal phasesActive
IdempotencyRequiredKey
Host statusMapped in recorded snapshot

Recovery requires the saved run revision and unchanged workflow definition/input. An unknown effect cannot be converted to a known failed step and automatically replayed.

Request fields

FieldTypeMeaning
RunEntityIdIdentity or revision in this model’s domain; preserve ownership and exact spelling.
ExpectedRevisionRevisionRevision observed before this change. Preserve it exactly; a mismatch requires re-reading and reconciling the target.
DefinitionDigeststringDomain value named by this field; additional accepted values and bounds are determined by the operation and Host policy.

Successful result

Work has been admitted. Read or watch the owned operation through Tasks to establish its terminal result; admission is not completion.

Failure and retry

Unavailable capability, denied permission, wrong phase, malformed schema or foreign ownership fails the call. Supply a key for the intended effect and retain that key and inputs while resolving an uncertain reply. Do not retry with changed inputs under the same key. Re-read after revision conflicts; cancellation does not prove rollback. Preserve structured errors; see recovery guidance.

C binding (call fragment; the caller supplies the encoded request and buffers):

c
nx_Workflows_Resume(&reply, request, &options);

The next resume receives the reply. Check nx_reply_success before nx_Workflows_Resume_result. See the complete continuation example and Wasm ownership rules. This fragment is not a standalone guest.

RetryStep ​

WorkflowStepRequest → OperationRef

PropertyContract
Local SDK method ID10
KindOperation
Permissionnexa.workflows.write
Legal phasesActive
IdempotencyRequiredKey
Host statusMapped in recorded snapshot

Request fields

FieldTypeMeaning
RunEntityIdIdentity or revision in this model’s domain; preserve ownership and exact spelling.
StepIdstringDomain value named by this field; additional accepted values and bounds are determined by the operation and Host policy.
ExpectedRevisionRevisionRevision observed before this change. Preserve it exactly; a mismatch requires re-reading and reconciling the target.
IdempotencyKeystringDomain value named by this field; additional accepted values and bounds are determined by the operation and Host policy.

Successful result

Work has been admitted. Read or watch the owned operation through Tasks to establish its terminal result; admission is not completion.

Failure and retry

Unavailable capability, denied permission, wrong phase, malformed schema or foreign ownership fails the call. Supply a key for the intended effect and retain that key and inputs while resolving an uncertain reply. Do not retry with changed inputs under the same key. Re-read after revision conflicts; cancellation does not prove rollback. Preserve structured errors; see recovery guidance.

C binding (call fragment; the caller supplies the encoded request and buffers):

c
nx_Workflows_RetryStep(&reply, request, &options);

The next resume receives the reply. Check nx_reply_success before nx_Workflows_RetryStep_result. See the complete continuation example and Wasm ownership rules. This fragment is not a standalone guest.

ExplainPlan ​

WorkflowRequest → ValidationReport

PropertyContract
Local SDK method ID11
KindQuery
Permissionnexa.workflows.read
Legal phasesInitialize, PostInitialize, Checkup, Finalize, Active
IdempotencyReadOnly
Host statusMapped in recorded snapshot

Request fields

FieldTypeMeaning
WorkflowQualifiedIdIdentity or revision in this model’s domain; preserve ownership and exact spelling.
InputsAbiValueTyped input value encoded under the declared input schema.
DefinitionDigeststringDomain value named by this field; additional accepted values and bounds are determined by the operation and Host policy.

Successful result

Decode the exact output model after Success. Preserve its identities, revision and schema metadata for subsequent domain operations.

Failure and retry

Unavailable capability, denied permission, wrong phase, malformed schema or foreign ownership fails the call. A read-only classification does not bypass budgets or guarantee a failed request can be retried indefinitely. Preserve structured errors; see recovery guidance.

C binding (call fragment; the caller supplies the encoded request and buffers):

c
nx_Workflows_ExplainPlan(&reply, request, &options);

The next resume receives the reply. Check nx_reply_success before nx_Workflows_ExplainPlan_result. See the complete continuation example and Wasm ownership rules. This fragment is not a standalone guest.

ReadRunTrace ​

EntityRequest → WorkflowTrace

PropertyContract
Local SDK method ID12
KindQuery
Permissionnexa.workflows.read
Legal phasesInitialize, PostInitialize, Checkup, Finalize, Active
IdempotencyReadOnly
Host statusMapped in recorded snapshot

Request fields

FieldTypeMeaning
IdEntityIdIdentity in this model’s domain. Use the identity issued or declared for this object, not a display name or filesystem path.

Successful result

Decode the exact output model after Success. Preserve its identities, revision and schema metadata for subsequent domain operations.

Failure and retry

Unavailable capability, denied permission, wrong phase, malformed schema or foreign ownership fails the call. A read-only classification does not bypass budgets or guarantee a failed request can be retried indefinitely. Preserve structured errors; see recovery guidance.

C binding (call fragment; the caller supplies the encoded request and buffers):

c
nx_Workflows_ReadRunTrace(&reply, request, &options);

The next resume receives the reply. Check nx_reply_success before nx_Workflows_ReadRunTrace_result. See the complete continuation example and Wasm ownership rules. This fragment is not a standalone guest.


来源: NexaCL-Plugin-SDK · Apache-2.0.

Site documentation: CC BY-SA 4.0. Imported SDK documents: Apache-2.0 as marked.