pub struct FlowEngine { /* private fields */ }Implementations§
Source§impl FlowEngine
impl FlowEngine
pub async fn new( packs: Vec<Arc<PackRuntime>>, config: Arc<HostConfig>, ) -> Result<FlowEngine, Error>
Sourcepub fn with_rollout_ids(self, rollout_ids: RolloutIds) -> FlowEngine
pub fn with_rollout_ids(self, rollout_ids: RolloutIds) -> FlowEngine
Bind the rollout identifiers of the revision-keyed runtime this engine serves, so every invocation’s telemetry carries deployment/bundle/ revision attribution (C5.4). Called by the Phase-D revision dispatcher when it constructs a revision runtime; tenant-only runtimes leave the default (empty) IDs.
Sourcepub fn rollout_ids(&self) -> &RolloutIds
pub fn rollout_ids(&self) -> &RolloutIds
The rollout identifiers bound to this engine (read counterpart to
with_rollout_ids). Empty by default for the
legacy tenant-only path.
Sourcepub fn set_cross_pack_resolver(&mut self, resolver: Arc<dyn CrossPackResolver>)
pub fn set_cross_pack_resolver(&mut self, resolver: Arc<dyn CrossPackResolver>)
Set an optional cross-pack resolver for provider.invoke nodes that
reference providers in other packs (resolved via capability registry).
Sourcepub fn set_remote_dispatch_handler(
&mut self,
handler: Arc<dyn RemoteDispatchHandler>,
)
pub fn set_remote_dispatch_handler( &mut self, handler: Arc<dyn RemoteDispatchHandler>, )
Set the handler that bridges sorla.call flow nodes into a separate
runtime over pub/sub. Constructed by the runner binary when a transport
(e.g. NATS) is configured.
Sourcepub fn set_agent_node_handler(&mut self, handler: Arc<dyn AgentNodeHandler>)
pub fn set_agent_node_handler(&mut self, handler: Arc<dyn AgentNodeHandler>)
Set the handler that bridges DwAgent flow nodes into the agentic-worker
runtime. Constructed by the runner binary (Task 4.3).
Sourcepub fn set_graph_node_handler(&mut self, handler: Arc<dyn GraphNodeHandler>)
pub fn set_graph_node_handler(&mut self, handler: Arc<dyn GraphNodeHandler>)
Set the handler that bridges DwAgentGraph flow nodes into the durable
graph executor. Constructed by the pack loader (Task 8). Mirrors
set_agent_node_handler.
Sourcepub fn set_dw_agent_dispatch(&mut self, mode: DwAgentDispatch)
pub fn set_dw_agent_dispatch(&mut self, mode: DwAgentDispatch)
Set the dispatch mode for dw.agent nodes.
- [
DwAgentDispatch::InProcess] (default): runs the agent in-process viaAgentNodeHandler. Zero configuration overhead; today’s behaviour. - [
DwAgentDispatch::Nats]: reroutes the node over the durable agentic NATS path (greentic.agentic.request.v1), identical to anagentic.callnode. Requiresset_remote_dispatch_handlerto also be set.
Called by runtime.rs when GREENTIC_AW_DISPATCH=nats.
pub async fn execute( &self, ctx: FlowContext<'_>, input: Value, ) -> Result<FlowExecution, Error>
Sourcepub async fn execute_from(
&self,
ctx: FlowContext<'_>,
input: Value,
entry_node: &str,
) -> Result<FlowExecution, Error>
pub async fn execute_from( &self, ctx: FlowContext<'_>, input: Value, entry_node: &str, ) -> Result<FlowExecution, Error>
Execute a flow whose cursor starts at entry_node instead of the flow’s
declared entrypoint.
Card-driven messaging packs carry the id of the next node to run on the
inbound activity (the designer emits it as nextCardId). A host that can
only call FlowEngine::execute restarts such a flow at its entrypoint
on every turn, so the capture nodes chained between two cards never run.
Unlike FlowEngine::resume this needs no persisted FlowSnapshot:
state starts fresh from input. That is what makes it usable for packs
whose pause points are rendered cards rather than session.wait nodes —
those never park, so they never leave a snapshot behind.
An entry_node that is not a node of the flow is a hard error. Falling
back to the entrypoint would re-introduce the silent restart this exists
to remove.
pub async fn resume( &self, ctx: FlowContext<'_>, snapshot: FlowSnapshot, input: Value, ) -> Result<FlowExecution, Error>
Source§impl FlowEngine
impl FlowEngine
pub fn flows(&self) -> &[FlowDescriptor]
Sourcepub async fn flow_node_ids(&self, pack_id: &str, flow_id: &str) -> Vec<String>
pub async fn flow_node_ids(&self, pack_id: &str, flow_id: &str) -> Vec<String>
Node ids declared by a flow, for callers that must tell a flow node
apart from something else that shares the id space — a card asset, in
the case of crate::runner::card_nav.
Loads the flow if it is not cached yet; an unloadable flow yields an empty list rather than an error, because the caller’s question (“is this a node?”) has a sound negative answer either way.
pub fn flow_by_key( &self, pack_id: &str, flow_id: &str, ) -> Option<&FlowDescriptor>
pub fn flow_by_type(&self, flow_type: &str) -> Option<&FlowDescriptor>
Sourcepub fn entry_flow_by_type(&self, flow_type: &str) -> Option<&FlowDescriptor>
pub fn entry_flow_by_type(&self, flow_type: &str) -> Option<&FlowDescriptor>
Resolve a flow by type, considering only application entrypoint flows.
Used to disambiguate an inbound provider event (routed by flow type,
with no explicit pack_id/flow_id) when a pack registers one public
entrypoint plus internal helper flows of the same type — the common
“dispatcher + sub-flows” shape. Internal flows are only reachable via
flow.call, so they must never win a type-only route.
Flows owned by a messaging provider pack (its manifest declares a
messaging.* provider) are also excluded: a provider ships its own
ingress main/default flow that is plumbing for that provider, not
the application. In a multi-provider bundle that flow would otherwise
compete with the app’s real entrypoint and make the route ambiguous.
Returns None when zero or more than one application entry flow of the
type exists (genuinely ambiguous — the caller must then require a
pack_id).
pub fn flow_by_id(&self, flow_id: &str) -> Option<&FlowDescriptor>
Auto Trait Implementations§
impl !Freeze for FlowEngine
impl !RefUnwindSafe for FlowEngine
impl !UnwindSafe for FlowEngine
impl Send for FlowEngine
impl Sync for FlowEngine
impl Unpin for FlowEngine
impl UnsafeUnpin for FlowEngine
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request