WEBVTT

00:00:00.550 --> 00:00:03.077
A user call often starts a longer job.

00:00:03.896 --> 00:00:07.140
The public method checks the caller, submits work to Takt,

00:00:07.268 --> 00:00:09.354
and returns an execution ID.

00:00:10.172 --> 00:00:13.416
The workflow engine moves that execution through a defined

00:00:13.349 --> 00:00:13.976
graph.

00:00:14.794 --> 00:00:19.145
Here, reserve remotely, deliver locally, close remotely, then

00:00:19.078 --> 00:00:19.653
audit.

00:00:20.471 --> 00:00:22.778
Takt saves progress between steps.

00:00:23.596 --> 00:00:26.632
Waiting for one remote result does not stop the canister

00:00:26.565 --> 00:00:27.908
from serving other work.

00:00:30.117 --> 00:00:33.999
We author three things: Motoko types for persisted progress,

00:00:34.101 --> 00:00:37.762
functions that perform the work, and a takt dot JSON definition

00:00:37.695 --> 00:00:38.920
connecting the steps.

00:00:39.739 --> 00:00:42.384
A node names an operation and its next step.

00:00:43.202 --> 00:00:46.577
The generator checks the graph and the Motoko types, then

00:00:46.510 --> 00:00:48.608
produces typed runtime wiring.

00:00:49.426 --> 00:00:52.736
That same definition also supplies the inspector's graph.

00:00:53.554 --> 00:00:56.538
We edit the source definition, then generate again.

00:00:58.750 --> 00:01:00.965
Local tasks run synchronously.

00:01:01.783 --> 00:01:04.988
They can dispatch reducer actions through Rechain; business

00:01:04.921 --> 00:01:06.759
state stays with its reducers.

00:01:07.578 --> 00:01:11.616
Read steps use selectors, while transforms prepare typed data.

00:01:12.434 --> 00:01:14.220
A choice selects one route.

00:01:15.039 --> 00:01:18.517
Remote tasks can use Reactor to batch requests and addressed

00:01:18.450 --> 00:01:20.106
replies between canisters.

00:01:20.924 --> 00:01:23.231
Direct actor calls are supported too.

00:01:24.049 --> 00:01:27.918
Reactor supplies scheduling; Takt keeps the workflow's progress.

00:01:28.737 --> 00:01:32.267
A remote wait suspends this operation, not the whole engine.

00:01:34.450 --> 00:01:36.391
A Choice node takes one route.

00:01:37.210 --> 00:01:39.647
This workflow checks its input in order.

00:01:40.465 --> 00:01:42.511
Four units selects the remote audit.

00:01:43.330 --> 00:01:45.727
Five selects the local audit directly.

00:01:46.546 --> 00:01:49.569
The first matching selector supplies the next node's typed

00:01:49.502 --> 00:01:50.037
input.

00:01:50.856 --> 00:01:52.602
The other route stays quiet.

00:01:54.783 --> 00:01:58.170
A parallel node starts separate branches, each with its own

00:01:58.103 --> 00:02:00.344
typed input and execution progress.

00:02:01.163 --> 00:02:04.107
Both remote operations can be outstanding together.

00:02:04.926 --> 00:02:07.454
Each result is merged back into the parent.

00:02:08.272 --> 00:02:11.295
The continuation waits until both branches finish.

00:02:12.113 --> 00:02:15.514
A retry belongs to its own visit, so a completed sibling

00:02:15.447 --> 00:02:16.803
does not start over.

00:02:17.621 --> 00:02:21.204
Parallel work is not a distributed rollback: effects already

00:02:21.137 --> 00:02:23.495
sent still need their outcomes resolved.

00:02:25.683 --> 00:02:29.708
A workflow can start another workflow, even in another canister.

00:02:30.526 --> 00:02:33.145
Scheduling the child does not mean it has finished.

00:02:33.964 --> 00:02:36.140
Here, the parent waits for an event.

00:02:36.959 --> 00:02:39.916
The subscription is registered before starting the child,

00:02:40.058 --> 00:02:41.921
so an early event is not lost.

00:02:42.740 --> 00:02:46.114
The child waits until a saved deadline, then publishes through

00:02:46.047 --> 00:02:47.208
a reducer action.

00:02:48.026 --> 00:02:50.919
Its block notification travels back through Reactor.

00:02:51.737 --> 00:02:55.541
Takt matches the expected producer, topic, and wait address,

00:02:55.643 --> 00:02:57.221
then resumes the parent.

00:02:58.039 --> 00:03:00.424
These saved waits survive upgrades.

00:03:02.650 --> 00:03:04.904
Failures need different responses.

00:03:05.722 --> 00:03:09.279
A known temporary rejection can retry after backoff, within

00:03:09.212 --> 00:03:10.373
a configured budget.

00:03:11.191 --> 00:03:14.839
The attempt number changes; the operation identity and saved

00:03:14.772 --> 00:03:16.089
request stay the same.

00:03:16.907 --> 00:03:20.555
Safe retries depend on the participant's idempotency contract

00:03:20.488 --> 00:03:21.805
and its validity window.

00:03:22.623 --> 00:03:24.813
But a timeout does not prove failure.

00:03:25.631 --> 00:03:28.940
An unresolved Reactor request keeps waiting for its original

00:03:28.873 --> 00:03:29.461
reply.

00:03:30.280 --> 00:03:33.615
If the outcome cannot safely be established, the workflow

00:03:33.548 --> 00:03:36.558
blocks for reconciliation using authoritative evidence.

00:03:37.376 --> 00:03:39.591
A known failure can take a catch route.

00:03:40.410 --> 00:03:43.823
Compensation is a new business action, not an undo button

00:03:43.756 --> 00:03:44.969
for remote effects.

00:03:47.150 --> 00:03:50.485
The inspector reads the canister's execution state and displays

00:03:50.418 --> 00:03:52.021
the same compiled graph.

00:03:52.840 --> 00:03:56.331
Select a node to see its visits, attempts, and outcome.

00:03:57.150 --> 00:04:00.641
A visit is one entry into a node; retries are attempts

00:04:00.574 --> 00:04:01.813
inside that visit.

00:04:02.631 --> 00:04:05.914
Enable tracing for retained execution history; it is off

00:04:05.847 --> 00:04:06.774
by default.

00:04:07.592 --> 00:04:11.357
The timeline shows how long each node takes, including remote

00:04:11.290 --> 00:04:13.037
attempts and retry waits.

00:04:13.855 --> 00:04:17.151
The instruction view shows recorded cost per node, on a

00:04:17.084 --> 00:04:18.701
cumulative cost axis.

00:04:19.519 --> 00:04:23.063
Here, Deliver uses nearly a million instructions while sharing

00:04:22.996 --> 00:04:24.508
one IC timestamp.

00:04:25.327 --> 00:04:28.584
Waiting takes time; executing takes instructions.

00:04:29.402 --> 00:04:32.034
Caller and participant measurements stay separate.

00:04:32.853 --> 00:04:35.107
Rechain records business changes.

00:04:35.926 --> 00:04:38.167
Reactor moves and schedules work.

00:04:38.985 --> 00:04:43.167
Takt makes the whole workflow explicit, persistent, and inspectable.

