Import an automation from JSON
Make an automation by pasting a JSON document, and the format Export JSON gives, with what starts it, its steps and the details they use.
An automation can be made from a JSON document instead of being built step by step:
- In Automations, choose Import JSON…, paste the document and choose Import automation. The automation is made in Personal or the selected team, off, and opens in the editor.
- In an automation, choose More, then Export JSON, to save its document as a file. You can import that file in another team, or give it to someone to start from.
Use Copy the prompt in the import box to copy this format with the instructions an AI assistant needs. Paste it into the assistant you use, say what should start the automation and what should happen, and paste back the JSON it gives you.
What an import does
- The automation is always made off. Nothing runs until you choose Turn on, which checks every step first.
- Every record it names (which form, which spreadsheet, which board or List) is left to choose. A document never links to a record by itself, so an automation from another team cannot reach that team's records. The editor marks each one, with the name the document gave it, and Turn on waits until each is chosen.
- An import is refused, and nothing is made, when the document names an event, an action or a detail that Magpie does not have. The message says which one, so it can be pasted back to the assistant to correct.
- Send the details to a web address's Web address and Secret to sign with, and the member Send an email goes to, are left empty, and Turn on asks for them. An export writes them empty too.
- An answer that belongs to a record still to choose, such as a spreadsheet's column, is left out. Choosing the spreadsheet, or New spreadsheet for these details, gives the step its columns again.
Export JSON writes no identifier of a record, a member or a team. A form's
question is named by its words, answer:Which day, and is marked in the
editor until it is chosen again after the form.
The document
{
"format": 1,
"name": "Lunch sign-ups to Contacts",
"when": {
"event": "forms.answered",
"subject": {"kind": "form", "name": "Team lunch"},
"options": {}
},
"steps": [
{
"id": "s1",
"kind": "only_if",
"match": "all",
"conditions": [
{"left": {"from": "when", "detail": "first_email"}, "is": "not_empty"}
]
},
{
"id": "s2",
"kind": "action",
"action": "contacts.add_or_update",
"answers": {
"email": [{"from": "when", "detail": "first_email"}],
"name": [{"from": "when", "detail": "first_name"}],
"tags": [{"text": "Lunch"}]
}
},
{
"id": "s3",
"kind": "action",
"action": "todos.add",
"answers": {
"title": [{"text": "Welcome "}, {"from": "s2", "detail": "name"}],
"due_days": [{"text": "2"}],
"list": [{"record": {"kind": "todo_list", "name": "Follow-ups"}}]
}
}
]
}
| Field | Required | What it is |
|---|---|---|
format |
No | 1. Leave it out or write 1. |
name |
No | The automation's own name, up to 255 characters. Without one, Magpie names it by its sentence. |
when |
Yes | What starts it: event, subject and options. null leaves it to choose. |
steps |
Yes | The steps in the order they happen. An empty list is allowed. |
No other field is allowed at the top, so a misspelled field is refused by name.
What starts it
eventis one of the event keys below.subjectisnullfor every record of that kind ("any form"), or{"kind": "form", "name": "Team lunch"}for one record, which is left to choose. Only the events marked "one record" take a subject.optionsis{}, except for a set time and a date.- For a set time:
{"every": "day", "time": "09:00"},{"every": "week", "days": [1, 5], "time": "09:00"}(1 is Monday, 7 is Sunday) or{"every": "month", "day": 1, "time": "09:00"}, in the team's time zone. - For a date:
relationisbefore,onorafter, as the date offers (table below).beforeandafteralso takeamount, a whole number, andunit. A date with no time of day takesdays, 1 to 365, and needstime, such as"09:00", in the team's time zone:{"relation": "before", "amount": 2, "unit": "days", "time": "09:00"}. A date with a time takesminutes(5 to 120),hours(1 to 48) ordays(1 to 365), and notime:{"relation": "before", "amount": 1, "unit": "hours"}, or{"relation": "on"}for the moment itself. - Options a date or a set time cannot use leave the automation to fix before Turn on, with the problem marked on its When.
| Event key | What starts it | One record | Details |
|---|---|---|---|
forms.answered, forms.paid |
A form is answered, or paid for | form |
first_email, first_name, respondent, answered_at, form, response_address, and each question as answer: and its words (and amount_paid when paid) |
meetings.booked, meetings.confirmed, meetings.rescheduled, meetings.cancelled |
A meeting is booked, confirmed, moved or cancelled | attendee, attendee_name, attendee_email, attendee_phone, start, length, notes, meeting |
|
contacts.added |
A contact is added | contact, name, email, phone, company, tags |
|
contacts.tagged |
A tag is added to a contact | contact_tag |
The contact's details, and tag |
contacts.note_added |
A note is added to a contact | The contact's details, and note, note_kind, note_by |
|
todos.added, todos.assigned |
A To-do is added, or assigned to someone | todo_list |
title, notes, list, deadline, assignee, todo, and added_by or assigned_by |
todos.completed |
A To-do is completed | todo_list |
title, notes, completed_by, todo |
issues.added, issues.completed |
An issue is added or completed | issue_project |
title, description, priority, status, reporter, issue |
issues.assigned, issues.status_changed, issues.commented |
An issue is assigned, its status changes, or someone comments | issue_project |
The issue's details, and assignee and assigned_by, or previous_status, or comment and commenter |
kanban.card_added, kanban.card_moved |
A card is added or moved | kanban_board |
title, description, column, board, card |
kanban.card_assigned, kanban.card_commented |
A card is assigned, or someone comments on it | kanban_board |
The card's details, and assignee and assigned_by, or comment and commenter |
store.order_paid, store.order_fulfilled, store.order_refunded |
An order is paid, sent or refunded | buyer, buyer_name, buyer_email, buyer_phone, order_number, total, items, order (and refund_amount when refunded) |
|
store.return_requested |
A customer asks to return an order | The order's details, and return_number, return_reason, return_items, return_note |
|
store.quote_requested |
Someone asks for a quote | quote_from, quote_name, quote_email, quote_message, quote_items, quote_subtotal, quote_number, quote |
|
store.review_posted |
Someone reviews a product | product_name, product, review_rating, review_title, review_text, reviewer, buyer, buyer_email, order_number |
|
store.stock_low |
A product's stock is low | product_name, variant, quantity_left, product |
|
invoicing.invoice_sent |
An invoice is sent | client, client_name, client_email, client_company, invoice_number, total, due_date, invoice |
|
invoicing.invoice_paid |
An invoice is paid | client, client_name, client_email, client_company, invoice_number, amount_paid, invoice |
|
proposals.sent, proposals.viewed, proposals.accepted, proposals.declined, proposals.expired |
A proposal is sent, opened, accepted or declined, or expires | client, client_name, client_email, number, title, total, proposal (and valid_until when sent or expired) |
|
proposals.question_asked |
A client asks a question or for changes | The proposal's details, and message, message_kind |
|
signatures.sent, signatures.expired |
A document is sent for signing, or its request expires | document, signers, request, expires_at (and waiting_for when expired) |
|
signatures.signed |
Someone signs a document | document, signers, request, signer, signer_email, signed_at, waiting_for |
|
signatures.declined |
Someone declines to sign | document, signers, request, decliner, decliner_email, decline_reason |
|
signatures.completed |
Everyone has signed a document | document, signers, signed_at, request |
|
newsletters.subscribed, newsletters.unsubscribed |
Someone subscribes or unsubscribes | subscriber, subscriber_name, subscriber_email, how |
|
courses.applied, courses.enrolled, courses.completed, courses.certificate_issued, courses.access_ended |
Someone applies, a student enrols, completes the course or gets a certificate, or their access ends | course |
student, student_name, student_email, course |
courses.lesson_finished, courses.quiz_finished, courses.assignment_submitted |
A student finishes a lesson or a quiz, or hands in an assignment | course |
student, student_name, student_email, course, lesson (and quiz_passed, quiz_score for a quiz; handed_in_late for an assignment) |
webinars.registered, webinars.attended, webinars.question_asked, webinars.poll_answered |
Someone registers, attends, asks a question or answers a live poll | webinar |
attendee, attendee_name, attendee_email, webinar (and place when registered; asked for a question; question, choice for a poll) |
webinars.ended |
A webinar ends | webinar |
webinar, registered_count, attended_count |
automations.at_a_time |
At a set time | date, weekday |
|
todos.date_deadline, todos.date_when |
A To-do's Deadline, or its When date, arrives. No time of day; before, on, after |
todo_list |
title, notes, list, deadline, assignee, added_by, todo (and when_date for the When date) |
issues.date_due |
An issue's due date arrives. No time of day; before, on, after |
issue_project |
title, description, priority, status, reporter, due_date, assignee, issue |
kanban.date_due |
A card's due date arrives. No time of day; before, on, after |
kanban_board |
title, description, column, board, card, due_date, assignee |
invoicing.date_due |
An unpaid invoice's due date arrives. No time of day; before, on, after |
client, client_name, client_email, client_company, invoice_number, total, due_date, amount_owed, invoice |
|
meetings.date_start, meetings.date_end |
A meeting starts, or ends. A time; before, on, after |
attendee, attendee_name, attendee_email, attendee_phone, start, length, notes, meeting (and end when it ends) |
|
proposals.date_valid_until |
A proposal's last valid day arrives. No time of day; before, on |
client, client_name, client_email, number, title, total, proposal, valid_until |
|
courses.date_access_ends |
A student's access is about to end. A time; before |
course |
student, student_name, student_email, course, access_ends |
signatures.date_expires |
A signature request is about to expire. A time; before |
document, signers, request, expires_at |
|
contacts.date_last_contacted |
A contact's Last contacted date passes. No time of day; after |
contact_tag |
contact, name, email, phone, company, tags, last_contacted |
Steps
Every step has an id and a kind. An id is letters, digits, - or
_, up to 40 characters, used once in the document, and never when.
- Do something:
"kind": "action", anactionkey from the table below, andanswers, an object of answer keys and their parts. - Only if:
"kind": "only_if",match(allorany) andconditions. The run ends there unless they hold. - If or otherwise:
"kind": "branch",match,conditions, and the steps of each way,thenandotherwise. - Wait:
"kind": "wait",amount(a whole number) andunit(minutes,hoursordays), up to 90 days.
An automation has at most 30 steps, counting the steps inside each If or otherwise. If or otherwise steps can be nested 3 deep.
| Action key | What it does | Answers | Details it gives |
|---|---|---|---|
contacts.add_or_update |
Add or update a contact | email (required), name, phone, company, tags, note |
contact, name, email |
contacts.add_tags |
Add tags to a contact | contact or email, tags |
contact |
todos.add |
Add a To-do | title (required), notes, due_days (days after the event), due_date, list (a todo_list) |
todo, title |
notes.add |
Add a Note | title, text |
note, title |
kanban.add_card |
Add a card | board (a kanban_board), column (a column's name), title, description |
card, title |
spreadsheets.add_row |
Add a row to a spreadsheet | spreadsheet (required, a spreadsheet), and column: with a column's heading for each column, such as column:Email |
spreadsheet, row |
issues.add |
Add an issue | title (required), description, project (an issue_project) |
issue, title |
chat.post_message |
Post a message in a channel | channel (required, a chat_channel), message (required) |
none |
calendar.add_event |
Add an event | title (required), start (required, such as 2026-11-20 14:00, or a date for all day), length (minutes), notes |
event, title, start |
documents.make |
Make a document | title (required), text |
document, title |
newsletters.add_subscriber |
Add a subscriber | email (required), name |
none |
automations.send_email |
Send an email | to (required: person, or a member chosen in the editor), email (with person, the email address detail of what started it), subject (required), message (required) |
none |
automations.send_to_web_address |
Send the details to a web address | address (required), details (required, the details to send), secret (required) |
answered |
Answers and their parts
An answer is a list of parts, joined in order:
{"text": "Thanks, "}: typed words.{"from": "when", "detail": "first_name"}: a detail of what started it, or{"from": "s2", "detail": "name"}of an earlier Do something step. A step can use only the details of steps that always run before it.{"record": {"kind": "todo_list", "name": "Follow-ups"}}: a record, left to choose.
Conditions
A condition compares a detail with typed words or another detail:
{"left": {"from": "when", "detail": "total"}, "is": "more", "right": [{"text": "100"}]}. is is one of is, is_not, contains,
not_contains, starts_with, empty, not_empty, more, less,
before, after, yes and no. empty, not_empty, yes and no take
no right.
If an import is refused for a reason you cannot work out, Contacter l’assistance.
Demander à l’assistance Magpie
Envoyez à l’équipe Magpie une question sur tout ce que cet article n’explique pas.