upsert_workflow_knoten
Create or update a node of a workflow, matched by schluessel (for imported Pipedrive workflows the schluessel is the stage/phase id). Required: workflow_id, schluessel; name for new nodes. Optional: reihenfolge, art (start|schritt|ende), agent_id (responsible agent), agent_info (what an agent must know/do/check here — shown by get_workflow_status), ausloeser (Trigger when an object ENTERS the node: {art:'keine'} | {art:'mensch', an:<user_id>, nachricht?, wichtigkeit?(0-100), antworten?:[…]} → a handoff in that person's delegation inbox (website/app, no mail/WhatsApp) | {art:'agent', agent_id?, nachricht?} → a task for the agent (defaults to the node's agent_id). nachricht may use {{titel}}, {{objekt_id}}, {{knoten}} and any data field like {{Experte}}. nicht_wenn_offen:[thema,…] skips the trigger while the object already has an open handoff with one of these themes (e.g. the asbest automation's laborder, berichtspruefung, versand), so nothing is duplicated.), erledigt_wenn (Condition JSON over the object's data: {} = always; {feld, op, wert} with op eq|ne|in|nicht_in|enthaelt|exists|leer|gt|gte|lt|lte (feld is a column/field name or dotted path; for Pipedrive deals custom fields work by their NAME, e.g. 'Experte'); combine with {alle:[…]}, {eines:[…]}, {nicht:{…}}. — when the step counts as done), max_tage (overdue after n days), signale (how to recognise — from ANY mailbox of the tenant, whoever did it — that an object REACHED this step or is DONE with it: [{name, von?, an?, betreff?, text? (case-insensitive regexes; at least one), wirkung:'erreicht'|'erledigt', schieben?:boolean (default false: only record the evidence and close the open handoffs of the steps done; true: also move the object forward, in Pipedrive too — never backwards), schliesst_themen?:[thema,…] (extra handoff themes to close, e.g. laborder, berichtspruefung, versand), zuordnung?:'muster'|'adresse' (adresse: for mails without the id, the object is found by street + house number of the open deals; only a unique hit counts)}]. The object id comes from the mail via the workflow's objekt_muster (deals: 'DN 1000'). Checked every 5 minutes over the last 48 h; each hit once. Replaces the node's whole list), rollen (who does the step today and what code/AI could take over: {ausloeser, aktion (plain text), wer_heute:{mensch, code, ki} (plain text), heute:{mensch, code, ki} and potenzial:{mensch, code, ki} (work share in percent, each summing to 100), potenzial_text, aufwand_min (total effort per object today, weight for totals), anteil_objekte (0–1, share of objects passing the step), quelle ('schaetzung'|'gemessen')}. get_workflow returns the weighted totals), vorbereitung (prepare the step's work so a person only says yes/no/adjust (object or list): {name?, wann:'eintritt' (on entering; only objects that entered within the last 2 days) | 'nach_tagen' (tage:[7,21] → one preparation per threshold, counted from entering the node) | 'signal' (after a signal hit at this node), durch:{art:'agent', agent_id? (default the node's agent), auftrag:'what to prepare'} (the agent gets a task and delivers with set_vorbereitung) | {art:'code', regel:'nachfass_mail'} (template follow-up mail to the deal person), an:<user_id> (who decides), an_offene_uebergabe?:thema (instead attach the result text to the object's open handoff with this theme, e.g. berichtspruefung), frage?, antworten?:[{text, aktion:'mail_senden'|'stufe'|'nichts'|'anpassen', stufe?:<node schluessel, forward only>}] (default with a mail: 'Freigeben und senden'; 'Nein' and 'Anpassen: …' are always offered), wichtigkeit?(0-100), nicht_wenn_offen?:[thema,…]}. Nothing is ever sent to a customer without the person's explicit answer. Withdrawn automatically when the object leaves the node or an 'erledigt' signal hits; null removes it).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"workflow_id": "<workflow_id>",
"schluessel": "<schluessel>"
},
"name": "upsert_workflow_knoten"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| art | No | Node type: start, regular step or end | |
| name | No | Name of the workflow knoten | |
| rollen | No | Who does the step today and what code/AI could take over, with work shares | |
| signale | No | Mail patterns that show an object reached or finished this step; replaces the list | |
| agent_id | No | ID of the agent | |
| max_tage | No | Days after which an object at this node counts as overdue | |
| ausloeser | No | Trigger fired when an object enters the node (keine, mensch or agent) | |
| agent_info | No | What an agent must know, do or check at this node | |
| schluessel | Yes | Key of the node within the workflow; for Pipedrive the stage/phase ID | |
| reihenfolge | No | Position of the node in the workflow order | |
| workflow_id | Yes | ID of the workflow | |
| vorbereitung | No | Object or list of objects, null to remove. | |
| erledigt_wenn | No | Condition JSON over the object's data that marks the step as done |