At a glance
Approvals before money moves or notices go out
An approval is atask whose answer is a decision, followed by
a choice on that decision. Steps run in document order and
a choice runs only the section for its case. So a refund or a notice placed in the approved
section runs only after an approved answer. A rejection runs its own section and ends the run with
a result that says it was rejected. See
Approvals.
- The approver sees the facts. The task’s title and instructions can show values from earlier
steps, such as the policy, the dates and the amount. Data shown with the task is fixed when the
task is created. See
task. - Only assignees answer. A task goes to people or groups. Only the task’s assignees can answer it, in the Effective app or through the API. A procedure’s task can’t be reassigned by hand: its assignees are the ones the procedure names. A group stays assigned as a group, so changes to group membership still apply. See Assignees.
- The answer must be complete. An answer that doesn’t match the task’s form is refused. The first valid answer decides; a second answer can’t move the run forward twice. See On retry and resume.
- There is no timeout or automatic answer. Neither a task nor an agent step has a timeout: a run waits until someone answers, or until the agent submits a result. If a deadline depends on the approval, watch open tasks from your system, as in Answer a task.
- Approvers are told. When a task is created, each person it’s assigned to, and each member of a group it’s assigned to, gets a notification in Effective and an email. The email isn’t sent to anyone who has already read the notification or turned that email off, and may be skipped for the person the run acts as. A task assigned to a person by name also gets a due date. If it is still open on that date, Effective reminds those people in Effective, and later tells the procedure’s owner there. A task assigned only to a group gets no reminder, so watch its open tasks from your system.
The audit trail
Every run keeps a record of what it did. The run’s page in Effective shows:- the inputs the run started with, and its output or why it failed;
- each step’s inputs, output and status;
- each task, with the answer, the task and submission IDs, the note and attachments, who answered and when;
- each agent session, and child runs linked in both directions;
- the version the run ran.
webUrl for each
step. See Read the result.
Effective never writes a secret’s value to the source, the version or the run record. Code that
reads a secret must not return it in a step’s result, because results are recorded. A run also
never shows the message an effect’s code threw. A thrown message could hold a secret, so a failed
run shows only the step and a failure code. Return a refusal you need to keep as part of a step’s
result, and log details in your own systems.
To tie a run to your own records, have each write return the ID your system gave it, such as a
refund ID, and include it in the procedure’s result. The
Cancel a policy tutorial does this.
A workspace administrator can permanently delete a finished run through the API, unless other
runs or records depend on it. Effective keeps a minimal record of each deletion: the run ID,
procedure, final status, who deleted it and when. The delete operation is deprecated: it keeps
working until at least 2027-03-01, then may be removed. After that, contact Effective support to
have a run deleted. See
Delete a finished procedure run.
Deadlines
Await with until holds the run until an exact instant,
such as the date a cancellation notice must go out. It’s a timer, not a loop that keeps checking
the clock:
- the run holds nothing open while it waits, for minutes or for days;
- the instant is read once, when the wait starts, and recorded with the run;
- after a restart or a deployment, the run resumes and wakes at the same instant;
- an instant that has already passed continues at once.
wait decides when the next step starts. The step that follows sends the request, and your
system or mail vendor delivers the notice; its own record shows when the notice went out.
A few more things matter for deadlines:
- A polling
waitasks an outside system for a state, such as a payment being recorded, and has onetimeout. When it runs out, the wait fails the run or continues with a value you choose. See Polling form. - A schedule trigger starts runs at set times. It doesn’t replay firings missed while it was disabled, and it skips a firing while its previous run is still active. Keep scheduled runs short, or start one run for each item instead of working through every item in one run.
- A trigger runs as the person who enabled it. If that person can no longer run the procedure, or
their authorization goes stale, the trigger stops starting runs. An event that arrives while it
can’t start a run isn’t always reported in
lastError. See Create a trigger. - Watch triggers from your own systems: read each trigger’s
nextRunAt,runCountandlastError, or list the runs it started, and act when a run you expected is missing.
Writes that are safe to repeat
Effective doesn’t guarantee that a write happens exactly once. A step whose result is recorded is never run again, but a code step that was in progress when something failed can run again under its retry policy. By default it gets three attempts. So a write can reach your system twice, or reach it even though the answer never came back. See Writes to your systems. What makes a repeat harmless is an idempotency key: a value sent with a write so that the receiving system can recognize a repeat. Effective gives every attempt of one step the same key,operation.idempotencyKey, and you can build your own. A system that honours the key applies the
first request and answers the others with the same result. Your systems have to honour it;
Effective can’t do that for them.
- Build keys from the business request. A key such as
refund-CR-20931, built from your own request ID, is the same in every run for that request. Then a second run for the same request gets the first refund back instead of a new one. See Cancel, refund and notify, each with a key. - No key, one attempt. For a system that can’t honour a key, give the step a retry policy with one attempt. If the outcome is unknown, the run fails and a person checks, instead of retrying. This doesn’t stop a second run for the same request from writing again; for that, look for the earlier write first. See When your system has no idempotency key.
- Starting a run takes a key too. A start request with the same key returns the run it already started. See Start a run.
When something goes wrong
- Retries first. A code step that fails is retried under its policy. Code can stop at once when another attempt can’t help, such as when your system refuses the request. See Which failures retry.
- The run fails, and says where. When a step fails for good, the run ends
failed. Itsfailurenames the step and a code. Everything the run recorded before the failure stays. See When a step fails. - Writes that happened stay. Failing a run doesn’t undo a write that reached your system, and a procedure has no step that undoes earlier ones. Keep each write in its own step, so the record shows exactly which writes happened.
- Recover with a new run. A failed run’s status is final, and the API has no way to resume it. Fix the cause and start a new run with the same inputs. Keys built from the request make your systems answer the writes that already happened with their first result. See If a run fails partway.
- Or start again from a checkpoint. On a run’s page in the Effective app, Retry on a run that didn’t complete and Run again on a completed one start a new run from a checkpoint you pick, and Restart rewinds a run that hasn’t finished to a checkpoint. The page shows what starts again from there. Calls, child runs, waits and tasks from that point run again, so a write among them reaches your system a second time. Use these only when your systems honour keys built from the request.
- Expected refusals are results, not failures. A policy that can’t be cancelled, or a mismatch a person must explain, should come back as data the procedure routes on, so the run ends with a clear outcome.
- Find failed runs. List runs with
status=failedfrom your own system. See Read the result. To act on each failure as it happens, use aprocedure_run_terminaltrigger withmatch.outcomesset to["failed"]andmatch.procedureIdset to the procedure you follow.
Change control
- Versions never change. Each publish stores a new numbered version. A published version is never edited, and each run keeps the version it started with. See Runs and versions.
- Publishing checks, and runs nothing. Publishing refuses source that doesn’t compile, and checks each declared capability and each secret declaration. It never runs the procedure’s code.
- Try a change as a draft. A draft runs edited source without publishing it. It’s private unless you share it, and a trigger never starts one. A draft can’t declare secrets, so to try a procedure that reads credentials, run a stand-in copy without secrets. See Drafts.
- The live version moves on its own only when callers still fit. Runs that don’t name a version start the live one. A new version becomes live on its own only if its inputs and output match the live version’s. Otherwise it waits until someone makes it live. You can also make an earlier version live again. If someone else changed the live version since you read it, your change is refused. See The live version and Publish a new version.
- Review before you publish. Publishing a version with the same inputs and output makes it
live at once. To stage a change, pin callers and triggers to an exact version, or publish it
under a test
idfirst. - Pin what must not move. A run, a trigger or a child run can name an exact version instead of the live one. See A run pins its version.
- Test against test systems. Publish a copy with its own
idwhose code calls your test systems, with test credentials. See Run it against your systems.
Who can do what
See Who can do what.
- A run acts as a person. A run acts as the person who started it, or as the person who authorized its trigger. Each firing checks that person’s access again. Child runs act as the same person. See Who a run acts as.
- Code can only do what it declares. A pure function gets no network, secrets or clock. An effect declares what it may use: requests to public hosts, the secrets it names, or the exact Effective API operations it calls, each write named on its own. Publishing checks the declarations. See Capabilities.
- Secrets stay out of the source and the record. A procedure declares the credentials it needs; their values are set in Effective, as a shared value or a person’s own. Effective never writes a secret’s value to the source, the version or the run record. Code that reads a secret must not return it in a step’s result, because results are recorded. See Give a secret a value.
- Agents are bounded. An agent step’s tools and settings are fixed in the source, its input and result are checked, and your organization’s policies on models, tools and budgets are checked when you publish and when a run starts. See People and agents.
Running many at once
Each request starts its own run, with its own record. Inside a run, afor-each works through up to 1,000 items, as many at a
time as its concurrency allows, and a parallel runs a
fixed set of branches at the same time. Folder and event triggers start one run for each file or
event. See Many runs at once.
Before you go live
- Run a stand-in copy without secrets as a draft, then the procedure against test systems with test credentials.
- Start a second run for the same request, and check that your systems wrote nothing twice.
- Make a step fail on purpose, and check that you can find the failed run and see which step failed.
- Check who can publish, who can run, and which groups answer each task.
- Decide which callers and triggers follow the live version and which pin an exact one.