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.
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.
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