Skip to content
Actions for Obsidian icon Home Actions for Obsidian 2024.1.3 › Actions

Actions for Obsidian › Actions › Trigger Command

Executes an Obsidian command just like you’d do manually using its command palette.

Due to the way Shortcuts and Obsidian work together, with Actions for Obsidian as translator in-between, AFO needs to maintain an internal list of commands available in your vault(s). So before you can use this action, the list needs to be fetched at least once using the “Get Available Commands” action in order to populate the list of commands that is shown in the Shortcuts editor.



The vault to work in.

Type: Vault reference

Obsidian Command

Type: Command reference


As mentioned, AFO needs to know the list of available commands in order to let you select from it via its “Obsidian Command” parameter. So prepare two workflows, one for getting the list of commands from Obsidian and which is run occasionally and only when necessary, and another one for executing one or more commands from the list.

Workflow 1 (Getting the list):

  1. Get Available Commands action. Set “Vault” to your vault.

Run it once.

Workflow 2 (Executing commands):

  1. This here action, “Trigger Command”. Select a command from the list.


The Shortcuts workflow editor will get the list of commands from AFO when the action is initialized, which happens when you add a “Trigger Command” action to the workflow, and also (later on) when you re-open the workflow in the editor. The action will not be updated on list changes while it is open in the editor, though. (I wish I could work around that but at the time of this writing, I’ve yet to find a way.)

For example, when you have the two workflows described in the “Usage” section above open in the editor, side by side, the command list in Workflow 2’s action will show whatever it contained at the time of the action’s initialization in the editor. Running Workflow 1 will not change that, since the Shortcuts editor will not update the Trigger action in Workflow 2 with the new data. Only closing and re-opening Workflow 2 in the editor will do the trick.