How to work with the challenges
The challenges here are harder than the practice tasks, and are meant for those who finished and want to go deeper. Try on your own for at least 20 minutes before opening the hints, and the solution only after that. There is no single right solution: if your scenario meets the requirements, it is right.
Broken scenario โ find the bug
This is what real work looks like: something broke, and all you have is the History. Read the error, and pick the right fix.
Advanced: Round-robin between agents
๐ฌ The scenario
Split new leads between 3 agents in turns.
๐ฏ The requirements
- A counter in a data store.
- Pick an agent by the counter.
- Update the counter.
๐ฏ The desired result โ how the scenario should look and work
Click Run once and then each module: you will see its settings, and on the last module โ the output you should get.
๐ค Example of the final output
{
"i": 4,
"owner": "Michal"
}๐ฌ Stuck? To the guided solution with a click simulation โ
๐ก Hints (try without them first)
- Tools โ Increment function returns a rising number (reset by conditions you choose).
get(agents; (i mod 3) + 1).
Tools โ Increment function (Reset: Never) โ Set variable owner = get(split("Michal,Ron,Shira"; ","); (1.i - 1) mod 3 + 1). The Increment function keeps the counter itself โ without a data store!
๐ฌ The guided solution โ a click simulation
๐ธ The illustrated guide โ step by step, click by click
For every step: a screenshot of the (simulated) Make editor with the click spot marked, and below it exactly what to click and what to type. You can work from here next to an open Make window.
- 1A counter that never resetsTools โ Increment function with Reset: Never.

๐ธ Step 1.1 โ the red ring marks where to click 
๐ธ Step 1.2 โ the red ring marks where to click - In the left menu click Scenarios โ + Create a new scenario.
- Click the scenario name at the top left (New scenario) and type:
C08 - Round-robin. - Click the + (the big circle in the middle, or the half-circle to the right of the last module).
- In the search box type
Webhooksand click the Webhooks app. - In the list of actions choose Custom webhook.
- In the Webhook field type:
new-lead - Click OK (or Save) to close the module window.
- Click the + (the big circle in the middle, or the half-circle to the right of the last module).
- In the search box type
Toolsand click the Tools app. - In the list of actions choose Increment function.
- In the Reset a value field type:
Never - Click OK (or Save) to close the module window.
- 2Pick an agent by the counter(i โ 1) mod 3 + 1 returns 1, 2, 3, 1, 2โฆ

๐ธ Step 2 โ the red ring marks where to click - Click the + (the big circle in the middle, or the half-circle to the right of the last module).
- In the search box type
Toolsand click the Tools app. - In the list of actions choose Set variable.
- In the Variable name field type:
owner - In the Variable value field map (drag from the panel or type):
{{get(split("Michal,Ron,Shira"; ","); (2.i - 1) % 3 + 1)}} - Click OK (or Save) to close the module window.
- 3Save in the CRMInsert with owner.

๐ธ Step 3 โ the red ring marks where to click - Click the + (the big circle in the middle, or the half-circle to the right of the last module).
- In the search box type
PostgreSQLand click the PostgreSQL app. - In the list of actions choose Insert a row.
- In the Table field type:
deals - In the owner field map (drag from the panel or type):
{{3.owner}} - In the email field map (drag from the panel or type):
{{1.email}} - Click OK (or Save) to close the module window.
- 4Test: 4 leadsFour runs โ Michal, Ron, Shira, Michal.

๐ธ Step 4 โ the red ring marks where to click - Click โถ Run once at the bottom left.
- When the run ends, bubbles with numbers appear above the modules. Click the bubble of the last module and check the Output.
- The output should look roughly like this:
{ "i": 4, "owner": "Michal" }
Experts: Stage history
๐ฌ The scenario
Save every stage change in a deal_events table.
๐ฏ The requirements
- An events table.
- Record on every update.
- An average time-in-stage report.
๐ฏ The desired result โ how the scenario should look and work
Click Run once and then each module: you will see its settings, and on the last module โ the output you should get.
๐ค Example of the final output
{
"rows": [
{
"to_stage": "proposal",
"avg": "3 days 04:00"
}
]
}๐ฌ Stuck? To the guided solution with a click simulation โ
๐ก Hints (try without them first)
- A trigger in Postgres or recording from Make on every UPDATE.
- Window functions (lead) for computing the duration.
A table deal_events(deal_id, from_stage, to_stage, at). In the update API: UPDATE โฆ RETURNING the old one? Simpler: SELECT the stage before, UPDATE, INSERT an event. Report: avg(next_at - at) with lead(at) over (partition by deal_id order by at).
๐ฌ The guided solution โ a click simulation
๐ธ The illustrated guide โ step by step, click by click
For every step: a screenshot of the (simulated) Make editor with the click spot marked, and below it exactly what to click and what to type. You can work from here next to an open Make window.
- 1A deal_events tabledeal_id, from_stage, to_stage, at.

๐ธ Step 1 โ the red ring marks where to click - Open supabase.com/dashboard in your browser (the โSQL editorโ screen).
- On the screen you will see: create table deal_events (id bigserial primary key, deal_id bigint, from_stage text, to_stage text, at timestamptz default now());
- Click the Run button.
- 2Read the current stageIn the update API: SELECT stage before the update.

๐ธ Step 2.1 โ the red ring marks where to click 
๐ธ Step 2.2 โ the red ring marks where to click - In the left menu click Scenarios โ + Create a new scenario.
- Click the scenario name at the top left (New scenario) and type:
C08 - Stage history. - Click the + (the big circle in the middle, or the half-circle to the right of the last module).
- In the search box type
Webhooksand click the Webhooks app. - In the list of actions choose Custom webhook.
- In the Webhook field type:
update-deal - Click OK (or Save) to close the module window.
- Click the + (the big circle in the middle, or the half-circle to the right of the last module).
- In the search box type
PostgreSQLand click the PostgreSQL app. - In the list of actions choose Execute a query.
- In the Query field type:
select stage from deals where id = $1 - In the Parameters field map (drag from the panel or type):
{{1.id}} - Click OK (or Save) to close the module window.
- 3Update + record an eventUPDATE followed by an INSERT into deal_events.

๐ธ Step 3.1 โ the red ring marks where to click 
๐ธ Step 3.2 โ the red ring marks where to click - Click the + (the big circle in the middle, or the half-circle to the right of the last module).
- In the search box type
PostgreSQLand click the PostgreSQL app. - In the list of actions choose Update a row.
- In the Table field type:
deals - In the stage field map (drag from the panel or type):
{{1.stage}} - Click OK (or Save) to close the module window.
- Click the + (the big circle in the middle, or the half-circle to the right of the last module).
- In the search box type
PostgreSQLand click the PostgreSQL app. - In the list of actions choose Insert a row.
- In the Table field type:
deal_events - In the deal_id field map (drag from the panel or type):
{{1.id}} - In the from_stage field map (drag from the panel or type):
{{2.stage}} - In the to_stage field map (drag from the panel or type):
{{1.stage}} - Click OK (or Save) to close the module window.
- 4Average time-in-stage reportA query with lead(at) over (partition by deal_id).

๐ธ Step 4.1 โ the red ring marks where to click 
๐ธ Step 4.2 โ the red ring marks where to click - Click the + (the big circle in the middle, or the half-circle to the right of the last module).
- In the search box type
PostgreSQLand click the PostgreSQL app. - In the list of actions choose Execute a query.
- In the Query field type:
select to_stage, avg(next_at - at) from (select *, lead(at) over (partition by deal_id order by at) next_at from deal_events) x group by 1 - Click OK (or Save) to close the module window.
- Click โถ Run once at the bottom left.
- When the run ends, bubbles with numbers appear above the modules. Click the bubble of the last module and check the Output.
- The output should look roughly like this:
{ "rows": [ { "to_stage": "proposal", "avg": "3 days 04:00" } ] }
Boss challenge: RPC in Supabase
๐ฌ The scenario
Move the upsert logic into a function in the database, and Make only calls it.
๐ฏ The requirements
- A SQL function upsert_deal.
- A call from Make through REST (rpc).
- A secure key.
๐ฏ The desired result โ how the scenario should look and work
Click Run once and then each module: you will see its settings, and on the last module โ the output you should get.
๐ค Example of the final output
{
"data": 57
}๐ฌ Stuck? To the guided solution with a click simulation โ
๐ก Hints (try without them first)
insert โฆ on conflict (email) do updaterequires a unique constraint on email.- POST /rest/v1/rpc/upsert_deal.
create unique index on deals(email); create function upsert_deal(p jsonb) returns bigint โฆ on conflict โฆ returning id. In Make: HTTP POST https://xyz.supabase.co/rest/v1/rpc/upsert_deal with apikey and Authorization headers from Keychain. One module instead of three.
๐ฌ The guided solution โ a click simulation
๐ธ The illustrated guide โ step by step, click by click
For every step: a screenshot of the (simulated) Make editor with the click spot marked, and below it exactly what to click and what to type. You can work from here next to an open Make window.
- 1A unique index and a function in the databaseupsert_deal(p jsonb) with on conflict (email).

๐ธ Step 1 โ the red ring marks where to click - Open supabase.com/dashboard in your browser (the โSQL editorโ screen).
- On the screen you will see: create unique index on deals(email); ยท create function upsert_deal(p jsonb) returns bigint โฆ on conflict (email) do update โฆ returning id;
- Click the Run button.
- 2A key in KeychainKeychain โ the Supabase API key, not inside the module.

๐ธ Step 2 โ the red ring marks where to click - Open eu2.make.com/keychains in your browser (the โKeysโ screen).
- On the screen you will see: Add key ยท Type: API key ยท Name: supabase-service
- Click the Save button.
- 3Call the RPCHTTP POST to /rest/v1/rpc/upsert_deal.

๐ธ Step 3.1 โ the red ring marks where to click 
๐ธ Step 3.2 โ the red ring marks where to click - In the left menu click Scenarios โ + Create a new scenario.
- Click the scenario name at the top left (New scenario) and type:
C08 - RPC. - Click the + (the big circle in the middle, or the half-circle to the right of the last module).
- In the search box type
Webhooksand click the Webhooks app. - In the list of actions choose Custom webhook.
- In the Webhook field type:
deal - Click OK (or Save) to close the module window.
- Click the + (the big circle in the middle, or the half-circle to the right of the last module).
- In the search box type
HTTPand click the HTTP app. - In the list of actions choose Make a request.
- In the URL field type:
https://xyz.supabase.co/rest/v1/rpc/upsert_deal - In the Method field choose:
POST - In the Headers field type:
apikey + Authorization (Keychain) - In the Body field map (drag from the panel or type):
{"p": {{toJSON(1)}}} - Click OK (or Save) to close the module window.
- 4RunOne module instead of three โ the id comes back.

๐ธ Step 4 โ the red ring marks where to click - Click โถ Run once at the bottom left.
- When the run ends, bubbles with numbers appear above the modules. Click the bubble of the last module and check the Output.
- The output should look roughly like this:
{ "data": 57 }