1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
//! # Task outcome
//!
//! Type returned by every task execution. Replaces the historical
//! `(usize, Vec<Change>)` tuple — the bare `usize` doubled as both an HTTP-like
//! status (200) *and* an in-band control-flow signal (skip / halt) which made
//! the contract impossible to type-check. `TaskOutcome` makes the four cases
//! explicit; the audit-trail status code is derived from the variant.
//!
//! The `Vec<Change>` is no longer part of the return value — sync built-ins
//! emit changes via the executor's per-task buffer, async handlers via
//! `TaskContext`. The audit trail is recorded by the workflow executor based
//! on the variant returned here.
/// Status code recorded on the audit trail when a task halts the workflow.
///
/// Preserved from v3 (`FILTER_STATUS_HALT = 299`) so existing audit-log
/// consumers (e.g. dataflow-ui) keep parsing halt entries unchanged.
pub const HALT_STATUS_CODE: u16 = 299;
/// Outcome of a single task execution.
///
/// Returned by `AsyncFunctionHandler::execute` and by the engine's internal
/// sync-builtin dispatch path. The workflow executor uses the variant to
/// decide whether to continue, skip the audit trail, or halt the workflow.
///
/// HTTP-like status semantics (preserved from v3 and earlier):
/// - status `200` — normal completion
/// - status `400..500` — logged as a warning, workflow continues
/// - status `500..` — recorded; fails the workflow unless the task or
/// workflow has `continue_on_error = true`