Skip to content

Latest commit

 

History

History
52 lines (32 loc) · 2.44 KB

040-make-your-own-workflows.md

File metadata and controls

52 lines (32 loc) · 2.44 KB

Table of Contents

  1. Trigger Your Workflow
  2. Understanding Commands
  3. Using Pre-Defined Workflows
  4. Make Your Own Workflows
  5. Command Reference
  6. Alternative Methods
  7. Developer Docs

Overview

  • You can quickly turn just about anything in Roam into a workflow. Defining custom workflows accessible via the SmartBlocks Trigger is the primary use case of this extension.
  • A SmartBlock workflow follows a number of simple rules outlined below. There is a Workflow SmartBlock to help you get started.

Structure of a SmartBlocks:

A parent block on any page that has the tag #SmartBlock followed by the title defines a SmartBlock workflow. All child blocks are part of the workflow.

Example

Here's what this SmartBlock is saying:

  • #SmartBlock Meeting Agenda (This is the parent block, it will not be inserted when the action is triggered. Search for "Meeting Agenda" to trigger)
    • Child block 1 (all text in this block will be inserted, replacing the trigger in the current block)
    • Child block 2 (this block of text will be inserted as a sibling of the previous block) - Indented Child block (this block will be inserted and indented)

Formatting

Any formatting will be included in the output of the workflow, such as ** for bold, __ for emphasizing, and so on. All text within the block is preserved.

Block level settings, such as headers, alignment, and view type are also preserved.

Special Commands

Workflows can be "Smart" which means you can embed certain commands into your workflow to have it perform dynamic actions. See the command reference for documentation on all of the supported commands.

Example of SmartBlocks with commands

Description

  • #SmartBlock Meeting Agenda (Parent block, followed by children blocks)
    • Date: <%DATE:today%> <%TIME%>
    • <%IFDAYOFWEEK:1%> Monday detailed briefing

Helper Workflow

SmartBlocks includes a pre-defined workflow named Workflow Starter. It helps you start a new workflow quickly by inserting a template as a starting point. Visit this section for a list of all the other pre-defined workflows.