Concept overview: Workflow queries with formatted data
These workflows return formatted markdown from workflow queries so Cadence Web can render Custom Workflow Controls: Markdoc tags such as {% signal %} and {% start %} become buttons that signal this workflow or start a new one.
Requires Cadence Web v4.0.14 or newer for markdown rendering and interactive controls.
Constants used in the Markdoc snippets (domain, taskList, cluster) match QueryConstants.java: domain samples-domain, task list query, cluster cluster0.
- Cadence server running (e.g. Docker Compose from the Cadence repo).
- Cadence Web v4.0.14+ connected to the same cluster.
- From the repo root, build:
./gradlew build
Starters use domain samples-domain. If you see Domain samples-domain does not exist, register it before starting workflows:
./gradlew -q execute -PmainClass=com.uber.cadence.samples.common.RegisterDomainOr with the Cadence CLI:
cadence --domain samples-domain domain registerSee also the root README.md.
Leave this process running:
cd /path/to/cadence-java-samples
./gradlew -q execute -PmainClass=com.uber.cadence.samples.query.QueryWorkerRun one of the starters (each starts a new workflow execution on task list query):
Markdown Query — query name Signal in the Web UI:
./gradlew -q execute -PmainClass=com.uber.cadence.samples.query.MarkdownQueryStarterLunch Vote — query name options:
./gradlew -q execute -PmainClass=com.uber.cadence.samples.query.LunchVoteStarterOrder Fulfillment (ops dashboard) — query name dashboard:
./gradlew -q execute -PmainClass=com.uber.cadence.samples.query.OrderFulfillmentStarter- Open the UI (e.g. http://localhost:8088) and select domain
samples-domain. - Open the workflow run you started.
- Open the Query tab.
- Choose the query type (
Signal,options, ordashboard) and run it. - Use the rendered buttons; re-run the query to refresh markdown after signals.
| Sample | Workflow interface / impl | Query name |
|---|---|---|
| Markdoc + activity | MarkdownQueryWorkflow.java |
Signal |
| Lunch voting | LunchVoteWorkflow.java |
options |
| Order dashboard | OrderFulfillmentWorkflow.java |
dashboard |