Type of the context object passed to the action execution. This allows for type-safe context propagation from agents to actions. Defaults to any for backward compatibility.
Type of the context object passed to the action execution. This allows for type-safe context propagation from agents to actions. Defaults to any for backward compatibility.
OptionalAbortOptional AbortSignal that is aborted when the action exceeds its wall-clock
time budget (set via Action.MaxExecutionTimeMS or the engine default). Set
automatically by ActionEngine.RunAction() — callers should not populate it
directly. Long-running action implementations should poll this signal
(e.g. between batches, between retries, inside tight loops) and return
early with ResultCode = 'TIMEOUT' when it fires, so the enforcement is
cooperative rather than ending the Node process.
The engine also records the timeout on AbortSignal.reason as a string
describing which side (action vs engine default) supplied the budget,
which makes timeout-origin debugging straightforward.
The action entity to be run.
OptionalContextOptional context object that provides runtime-specific information to the action. This context is separate from the action parameters and is not stored in the database.
Common use cases include:
The context flows from agents to actions, maintaining consistency throughout the execution hierarchy. Actions can use this context to adapt their behavior based on runtime conditions without modifying their core parameter structure.
Note: Avoid including sensitive data like passwords unless absolutely necessary, as context may be passed through multiple execution layers.
The user context for the action.
OptionalDeferWhen set, replaces executing the action — after validation and filters have passed.
The seam durable dispatch hangs on. Submitting the work before this point would hand it over without the scope check and without the binding's filters ever running, so a scoped durable trigger would fire for every record and a filtered one on every save. Deferring here means the two paths share one gate: whatever decides an inline run should happen decides a durable one should be submitted.
Returning null declines the deferral and the action executes normally. That is what makes
the fallback free: a handoff that could not be completed becomes an ordinary run rather than
requiring the deferral to reimplement execution.
OptionalEntityWhat changed about the record, when this run was dispatched by an entity action.
Present only on the entity-action path — a directly invoked action has no record transition to describe. This is what makes a transition filter possible ("when Status becomes Approved"), as opposed to a state filter over current values, which was all a filter could see before.
Optional, a list of filters that should be run before the action is executed.
Optional, the input and output parameters as defined in the metadata for the action.
OptionalProvenanceOptional. Set by the Entity Action invocation path to record which binding, which event and which record produced this run — see ActionInvocationProvenance. Left undefined for direct invocations, which is what the execution log's NULL provenance columns mean.
OptionalProviderOptional metadata provider to use for entity lookups and data access during this action run.
Why this matters for transaction isolation in multi-provider scenarios: MemberJunction supports running multiple providers in the same process (e.g., a transaction-scoped provider for a unit-of-work, alongside the default global provider). When an action runs inside a transaction, it MUST use the same provider that owns the transaction so that all reads/writes happen on the same connection and participate in the same transaction.
If Provider is not supplied, action implementations fall back to the default global provider via
new Metadata(). This preserves backward compatibility for single-provider deployments and for
existing callers that don't yet thread a provider through.
Action implementations should use the pattern:
const md = params.Provider ?? new Metadata();
to honor the caller's provider when supplied while remaining backward compatible.
OptionalSkipOptional, if true, an MJActionExecutionLogEntity will not be created for this action run.
Class that holds the parameters for an action to be run. This is passed to the Run method of an action.
Example