The Mystery of a Missing Greeting

Published: (December 10, 2025 at 11:51 PM EST)
2 min read
Source: Dev.to

Source: Dev.to

Source Code and Setup

The source code for this exercise is available at . You can clone the repo and follow its README’s setup steps to run this sequence on your machine, or simply follow along here.

Some output in the fragments below is omitted for brevity.

iex(1)> import Journey.Node
Journey.Node
iex(2)> graph = Journey.new_graph(
  "Customer Onboarding",
  [
    input(:name),
    input(:email_address),
    compute(
      :greeting,
      [:name, :email_address],
      fn values ->
        welcome = "Welcome, #{values.name} at #{values.email_address}"
        IO.puts(welcome)
        {:ok, welcome}
      end
    )
  ]
)

The application starts an execution of this workflow (Journey.start(graph)) for every customer as they navigate your website. Customers are greeted, and the business thrives.

The Mystery of a Missing Greeting

All of a sudden you get a call from your co‑founder, Ms. Too‑Ticky:

“Mr. Hemulen, our newest customer, did not get his ‘welcome’ greeting! Why?!?”

No worries—Journey.Tools.introspect/1 comes to the rescue!

Mystery Solved?

Let’s introspect Mr. Hemulen’s onboarding execution to see whether :greeting computed.

iex(5)> Journey.Tools.introspect(eid) |> IO.puts()
Values:
- Set:
  - name: '"Hemulen"' | :input
    set at 2025-12-10 09:02:16Z | rev: 1

- Not set:
  - email_address:  | :input
  - greeting:  | :compute

Computations:
- Outstanding:
  - greeting::not_set (not yet attempted) | :compute
       :and
        ├─ ✅ :name | &provided?/1 | rev 1
        └─ 🛑 :email_address | &provided?/1

:greeting is blocked because we have Mr. Hemulen’s :name but not his :email_address.

Mystery Solved! Hello, Mr. Hemulen!

As soon as Mr. Hemulen provides his email address, the greeting is emitted:

iex> Journey.set(eid, :email_address, "hemulen@gojourney.dev")
Welcome, Hemulen at hemulen@gojourney.dev

Verification

Now :greeting should be computed. Let’s check:

iex(7)> Journey.Tools.introspect(eid) |> IO.puts()
Values:
- Set:
  - greeting: '"Welcome, Hemulen at hemulen@gojourney.dev"' | :compute
    computed at 2025-12-10 09:03:06Z | rev: 4

  - email_address: '"hemulen@gojourney.dev"' | :input
    set at 2025-12-10 09:03:06Z | rev: 2

  - name: '"Hemulen"' | :input
    set at 2025-12-10 09:02:16Z | rev: 1

Computations:
- Completed:
  - :greeting (CMPR7RL0T7T2VTJAG9Z0748): ✅ :success | :compute | rev 4
    inputs used:
       :name (rev 1)
       :email_address (rev 2)

With both :name and :email_address present, :greeting is successfully computed. Ms. Too‑Ticky is happy. Mr. Hemulen is happy.

One call to Journey.Tools.introspect/1—mystery solved!

References

  • Source code for this walkthrough:
  • Journey library documentation:
Back to Blog

Related posts

Read more »