Word

action

A function that reaches outside: it may wait, call services and models, and write by calling a change.

Example

TypeScript
export const sendNote = action('sendNote', {
  access: role('staff'),
  run: async ({ input }) => ({ ok: input.note.length > 0 }),
})

Options

OptionMeans
option.action.accessWho may call the action.
option.action.runThe function that does the work.
option.action.aboutOne sentence on what the action is for.
option.action.inputThe fields that a call gives.
option.action.outputThe type of the answer.
option.action.dangerWhether AIs and MCP callers ask a person before the action runs.
option.action.sendsWhether the action sends data out.
option.action.offerThe outside doors the action is offered to.
option.action.deprecatedMarks the action as going away, in the API description and in its answers.
option.action.systemGives the action full access, with the reason.
option.action.backgroundRuns the action off the main thread.
option.action.workerThe kind of worker the action runs on.
option.action.batchGathers calls of the action into one.
option.action.rememberKeeps the answers of the action for the same input.
option.action.rowsPlans whose rows the action is handed.
option.action.usesThe functions, service calls and members of handles that the code asks the writer for.
option.action.changesThe builder's word on whether the action writes in the store.
option.action.callerGoneWhat becomes of the work when its caller is gone.
option.action.followWho may follow the runs of the action from a page.
option.action.countByFor whom the calls of the action are counted.
option.action.limitsThe limits of the action.
option.action.plainHolds the action to the plain form.
option.action.wasThe old name of the action, where it was renamed.

Returns

A function that answers a promise. An action that states follow also gives the member working.

Errors

code.T0010: it was called with no engine: nothing stands in the runtime slot.

See also

topic.words