Ask for approval before acting
Some steps should not happen on their own: taking off over people, switching on a jammer, flying into busy airspace. A Human approval step stops the run until a person approves or rejects it, and you decide what happens in each case.
Before you begin
- A console account that can edit Skills, and the Approver role to decide approvals yourself.
- A Skill to add the step to. This guide uses the one from the Quickstart: take off, fly to a position, point the camera at it.
What you'll build
The Skill asks for approval first. Approved, the drone takes off and responds as before. Rejected, or left unanswered for 5 minutes, the run ends without the drone ever leaving the ground.
Add the approval step
Place it first
Open your Skill in Build›Skills. From Control flow in the palette, drag Human approval onto the canvas and connect it in front of flight.takeoff. The first step is marked START.
Put the approval where the risk begins. Before the takeoff, nothing happens while the run waits. After it, the drone hovers in the air until someone answers.
Fill in its settings
Select the step to open its settings.
Setting What to enter Approval type A short word for what is being approved, for example launch. It is shown with every request. Required. Approval group approver, so only users with the Approver role can decide. Leave it empty to let anyone in your organization decide.Timeout (seconds) How long to wait for an answer, for example 300. Leave it empty to wait until someone answers.Decide what happens on a rejection
Drag End from the palette onto the canvas and connect the approval step to it. Select the new connection and set its Type to On failure. The connection turns red.
The connection to flight.takeoff stays Normal: it is followed when the step is approved.
Save
Add a note in What changed?, for example Ask before taking off, and select Save.
Which connection is followed
| The approver | The run follows |
|---|---|
| Approves | The Normal or On success connections. |
| Rejects | The On failure connections. |
| Doesn't answer within the timeout | The On timeout connections, or the On failure connections if there are none. |
When the run reaches End through one of these branches, it counts as succeeded: the rejection was handled the way you planned. Without a failure connection, a rejection fails the run.
Approve or reject a request
When a run reaches the approval step, the console shows the request on every page:
To see what you are approving first, select Review it in the banner. The run's page shows which step is waiting and what comes next. Select Approve or Reject.
A rejected request takes the failure branch. Here the drone never took off: the commands are skipped, and the run ended through End.
What you have now
- A Skill that only flies when a person approves it.
- A planned outcome for a rejection and for no answer, so neither leaves a drone waiting.
- Approval requests that reach the right people wherever they are in the console.
An Application that uses this Skill asks for the same approval, also when an event trigger or a schedule starts it. If your Application follows the Skill's latest version, it picks up the approval step as soon as you save.
Troubleshooting
- The step shows Incomplete. Fill in Approval type.
- You see the request but can't approve it. The step is addressed to a group you are not in. Ask an organization administrator to give you the Approver role.
- The run failed after a rejection. The approval step has no On failure connection. Add one, for example to End or to flight.return_to_home.
- The run waits for ever. The step has no timeout, and nobody has answered. Answer it, or set a timeout.