Automate your work with AI, from the first rule to the complete workflow
Your progress
0 lesson completed out of 50

A lesson is completed when you tick it, when you watch its video to the end or when you score 80% on its quiz. The certificate is issued online after the final assessment, from a score of 32 out of 40.

Your progress is saved in this browser. Log in to your client area to pick it up on your other devices.

Video transcript

Lesson 31, module 8: Data, security and rules API keys, service accounts and access rights in a workflow The joinery firm's workflow holds four keys. Who else can use them?

A secret lives in the tool's credentials, and nowhere else. Not in a text field Not in the spreadsheet or the record Not in a shared export Every access is set on four layers. [Diagram: The four layers of an access] The vault The account The rights The cap When Claire leaves the company, her accounts will close. So will the workflow. A devis@ mailbox rather than Claire's Gmail A project's key, not a person's A webhook without authentication is an open door. Prompt: curl -X POST "https://[votre-instance]/webhook/[chemin]" -H "X-Cle-Webhook: $CLE_WEBHOOK" -d '{"test":true}' Response: With the right header, the workflow receives the request. Without the header or with a wrong value, n8n rejects the request and nothing runs. A leaked key is replaced within the hour, then revoked. [Diagram: A key has leaked] H+0: New key, old one revoked H+1: Spending and logs reviewed D+1: Cause found, record updated In the exercise, you clean up the access of a wine merchant.

Your turn: Clean up the access of a wine merchant The written lesson, the corrected exercise and the quiz are below the video.

Lesson 31 of 50 · module 8, data, security and rules

API keys, service accounts and access rights for a flow

A workflow holds keys: the AI key, access to the spreadsheet and the inbox, its webhook address. Store every secret in the tool’s credentials, never in a field or a spreadsheet, have it held by a company account, give it as few rights as possible, cap spending and protect the webhook.

  • 26 min of reading
  • 1 min 42 of video
  • 7 diagrams
  • 0 demande to copy
  • 3 exemples pratiques
  • 4 exercices answerss
  • 5 questions
  • 1 ressource

By the end of this lesson, you will know how to

  • Store every secret of a workflow in the tool’s credentials and spot those lying around elsewhere
  • Assign each access to a company account with the fewest possible rights and a spending cap
  • Protect a webhook and manage the replacement of a leaked key

What’s covered

  1. Where secrets live
  2. The account that runs each action
  3. As few rights as possible
  4. Protect the webhook
  5. When a key has leaked
  6. 3 worked examples, followed from start to finish
  7. Exercise with answers · Clean up a wine merchant’s access
  8. 3 practice exercises, from guided to demanding cases
  9. The quiz

Key points

  • A secret is entered once, in the tool’s credentials; never in a field, an expression, a spreadsheet, the workflow sheet or a shared export.
  • The accesses of a workflow meant to last belong to a company account that at least two people can reconnect.
  • Each flow has its own AI key, with a spending cap and an expiry date, and each access has the fewest rights possible.
  • A production webhook has authentication, and its address appears on no public page.
  • A leaked key is replaced and revoked within the hour; the response is written in the workflow sheet before you need it.