Skip to main content

execute_action

execute_action

async def execute_action(action_def: ActionResolverDef, inp: Any,
values: Mapping[str,
Any], static_kwargs: Mapping[str,
Any],
execution_id: str, ws_channel: str, store: CacheStore,
task_mgr: TaskManager) -> Union[Any, BaseTask]

Execute a given action with the provided context.

Resolves 'values' passed into an Action - DerivedVariables encountered are resolved into their values. If any of them are a Task/PendingTask, returns a MetaTask that can be awaited to retrieve the action.

Arguments:

  • action_def: resolver definition
  • inp: input to the action
  • values: values from the frontend
  • static_kwargs: mapping of var names to current values for static arguments
  • execution_id: random execution id to differentiate between multiple executions of the same action
  • uid: action instance uid
  • ws_channel: websocket channel to send messages to
  • store: the store instance to check for cached values
  • task_mgr: the task manager instance to use for running tasks