{"schema_version":"2","endpoint":"/api/v1/tasks/createOrUpdateTask","method":"POST","auth":{"alternatives":[{"header":"x-api-key","value":"<project API key>"}],"project_context":"Supplied by the API key; no project header is needed."},"validation_endpoint":"/api/v1/tasks/validate","discovery_endpoint":"/api/v1/tasks/authoring-options","models_endpoint":"/api/v1/models","models_usage":"GET /api/v1/models?type=1 lists project-enabled language models; type=2 selects media and type=3 transcription. Response: {docs:[{id,model,type,provider}],total,limit,skip,hasMore}. Follow pagination with skip and limit (maximum 100).","authoring_options":{"method":"GET","endpoint":"/api/v1/tasks/authoring-options","query_parameters":[],"response_schema":{"type":"object","additionalProperties":false,"properties":{"models":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"model":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S"},"type":{"type":"integer","minimum":1,"maximum":3}},"required":["model","type"]},"minItems":0,"maxItems":10000},"model_types":{"type":"object","additionalProperties":false,"properties":{"1":{"type":"string","enum":["language"]},"2":{"type":"string","enum":["media"]},"3":{"type":"string","enum":["speech_to_text"]}},"required":["1","2","3"]},"run_as":{"type":"array","items":{"type":"string","format":"email"},"minItems":0,"maxItems":10000},"api_server_timezone":{"type":"string","maxLength":20000},"schedule_timezone":{"type":"string","maxLength":20000},"notes":{"type":"array","items":{"type":"string","maxLength":20000},"minItems":0,"maxItems":100}},"required":["models","model_types","run_as","api_server_timezone","schedule_timezone","notes"]},"example":{"models":[{"model":"gpt-5.5","type":1},{"model":"whisper-1","type":3}],"model_types":{"1":"language","2":"media","3":"speech_to_text"},"run_as":["user@example.com"],"api_server_timezone":"Europe/London","schedule_timezone":"Scheduler host local timezone; the scheduler and API hosts must use the same timezone.","notes":["Models are organization-approved and enabled for this project; credentials and provider availability are checked at execution."]},"usage":"Filter models client-side by type: 1 for language prompts, 2 for media workflows, 3 for transcription. Use model verbatim. run_as contains eligible project-member emails: your identity, or other eligible members if you are an organization-admin. Values and timezone in this example are illustrative; use your server response."},"response_types":{"string":"Text response, commonly Markdown.","json":"Parsed JSON object or array. Describe the required structure in the prompt.","foreach":"Existing per-item instruction processing mode; not a substitute for a for_each step. Retain for configured legacy instructions.","code":"Requests executable code as the answer. This response setting is not a code execution step.","media":"Media response mode; requires a compatible model and configured media workflow.","task":"Requests a JSON array of task objects, each with a description; not a createOrUpdateTask payload.","list":"Legacy list mode used by export/dynamic-function workflows. Prefer json for a new AI-generated array."},"success_responses":{"create":{"status":201,"body":{"created":true,"task":{"id":"0123456789abcdef01234567","revision":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","name":"Hello task","steps":[{"id":"0123456789abcdef01234568","type":"code","name":"Prepare result","fields":{"code":"return { message: \"Hello\" };","output":"result","format":"json"},"description":""}],"active":false,"schedule":{"type":"manual"},"run_as":"user@example.com","notification":"errors","notification_emails":[],"log_reference":""}}},"update":{"status":200,"body":{"created":false,"task":{"id":"0123456789abcdef01234567","revision":"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb","name":"Hello task updated","steps":[{"id":"0123456789abcdef01234568","type":"code","name":"Prepare result","fields":{"code":"return { message: \"Hello\" };","output":"result","format":"json"},"description":""}],"active":false,"schedule":{"type":"manual"},"run_as":"user@example.com","notification":"errors","notification_emails":[],"log_reference":""}}},"validate":{"status":200,"schema":{"type":"object","additionalProperties":false,"properties":{"valid":{"type":"boolean","enum":[true]},"issues":{"type":"array","items":{},"maxItems":0},"warnings":{"type":"array","items":{"type":"string","maxLength":20000},"minItems":0,"maxItems":100}},"required":["valid","issues","warnings"]},"body":{"valid":true,"issues":[],"warnings":["Validation does not execute steps or verify external services."]}}},"agent_contract":{"create":"Omit id; supply name and at least one step. Defaults to inactive.","update":"GET first; retain task revision, step IDs and instruction IDs. Omitted settings are preserved; supplied steps replaces the list.","saves_run_task":false,"preservation":"Existing private settings and unchanged unsupported steps are preserved. Existing legacy branch layouts are preserved for content-only edits; changed layouts must satisfy the documented rules."},"common_mistakes":["Use unique step names.","Keep newly authored parent/branch subtrees contiguous.","Supplying steps replaces the entire list; omit it for settings-only updates.","Queued or running tasks cannot be edited.","Use an exact model from authoring-options; credentials must also be configured.","Output names do not include {{braces}}.","Retain IDs on renames, and update child parent names.","Do not delete unsupported steps to silence validation errors. Return them unchanged with their IDs."],"recommended_ai_type":"ai_agent","ai_types":{"ai_agent":{"recommended":true,"deprecated":false,"aliasOf":null,"description":"Use for new agent tasks; new instructions default to agent context (type 7)."},"ai_answer":{"deprecated":false,"aliasOf":null,"description":"Use for direct AI answers; new instructions default to answer context (type 3)."}},"error_shape":{"error":"Task validation failed","code":"invalid_request","issues":[{"path":"/steps/0/fields/output","code":"required","message":"output is required","step":"Prepare orders"}]},"status_codes":{"200":"Read, update or successful validation","201":"Created","400":"Invalid request; inspect issues","401":"Authentication required","403":"Permission denied","404":"Task not found in project","409":"Stale revision, queued/running task or conflicting saved configuration"},"validation_scope":"Checks schema, saved references, project permissions, model catalog and edit constraints. Does not execute steps or contact external providers. Independent schema errors are returned together; resolve these before semantic checks.","minimal_example":{"name":"Hello task","steps":[{"type":"code","name":"Prepare result","fields":{"code":"return { message: \"Hello\" };","output":"result","format":"json"}}]},"minimal_ai_example":{"name":"Hello AI","steps":[{"type":"ai_agent","name":"Say hello","fields":{"prompts":[{"prompt":"Say hello in one short sentence.","output":"greeting","model":"gpt-5.5","response":"string"}]}}]},"data_contract":{"syntax":"{{outputName}} or {{outputName.property}}; loop list uses outputName without braces.","fetch_email":{"emailAttachments":"array of stored attachment paths","emailBody":"email HTML/text","emailSender":"sender email","emailSubject":"subject","emailSendDate":"message date"},"transcribe_audio":"Reads emailAttachments; writes each configured output as text and outputQuality as an object. audioTranscription remains an alias for the first result.","code_and_http":"Writes the return value under fields.output. Its structure depends on your code or endpoint.","ai":"Prompts run in list order; later prompts may use earlier outputs. response json requests parsed JSON; specify the required properties in prompt text.","loops":"fields.item and fields.index are available to loop children.","scope":"Branch outputs are available only if that branch ran. Project API/environment tags require project configuration and are not implied by text references."},"schedule_types":[{"type":"manual","required":["type"],"schema":{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["manual"]}},"required":["type"]}},{"type":"yearly","required":["type","month","day_of_month","time"],"schema":{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["yearly"]},"month":{"type":"integer","minimum":1,"maximum":12},"day_of_month":{"type":"integer","minimum":1,"maximum":31},"time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."}},"required":["type","month","day_of_month","time"]}},{"type":"monthly","required":["type","day_of_month","time"],"schema":{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["monthly"]},"day_of_month":{"type":"integer","minimum":1,"maximum":31},"time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."}},"required":["type","day_of_month","time"]}},{"type":"weekly","required":["type","day_of_week","time"],"schema":{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["weekly"]},"day_of_week":{"type":"integer","minimum":0,"maximum":6,"description":"0 = Sunday, 6 = Saturday"},"time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."}},"required":["type","day_of_week","time"]}},{"type":"daily","required":["type","time"],"schema":{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["daily"]},"time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."}},"required":["type","time"]}},{"type":"hourly","required":["type"],"schema":{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["hourly"]}},"required":["type"]}},{"type":"every_15_minutes","required":["type"],"schema":{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["every_15_minutes"]}},"required":["type"]}},{"type":"every_5_minutes","required":["type"],"schema":{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["every_5_minutes"]}},"required":["type"]}},{"type":"every_minute","required":["type"],"schema":{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["every_minute"]}},"required":["type"]}},{"type":"interval","required":["type","interval_minutes","start_time","stop_time"],"schema":{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["interval"]},"interval_minutes":{"type":"integer","minimum":1,"maximum":1440},"start_time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."},"stop_time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."}},"required":["type","interval_minutes","start_time","stop_time"]}}],"authentication":"x-api-key: <project API key>. The key supplies project context; no project header is needed.","task_schema":{"oneOf":[{"type":"object","additionalProperties":false,"properties":{"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S"},"active":{"type":"boolean","default":false,"description":"New tasks are inactive by default. Saving does not queue a run."},"schedule":{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["manual","yearly","monthly","weekly","daily","hourly","every_15_minutes","every_5_minutes","every_minute","interval"]},"time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."},"month":{"type":"integer","minimum":1,"maximum":12},"day_of_month":{"type":"integer","minimum":1,"maximum":31},"day_of_week":{"type":"integer","minimum":0,"maximum":6,"description":"0 = Sunday, 6 = Saturday"},"interval_minutes":{"type":"integer","minimum":1,"maximum":1440},"start_time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."},"stop_time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."},"retry_until":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"Same-day retry deadline for daily, weekly, monthly and yearly schedules, inclusive. Defaults to 23:59. Runs retry from the first step after 5, 15, then every 30 minutes until a completed successful log starting on or after the scheduled time exists, or the deadline passes."}},"required":["type"],"oneOf":[{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["manual"]}},"required":["type"]},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["yearly"]},"month":{"type":"integer","minimum":1,"maximum":12},"day_of_month":{"type":"integer","minimum":1,"maximum":31},"time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."},"retry_until":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"Same-day retry deadline for daily, weekly, monthly and yearly schedules, inclusive. Defaults to 23:59. Runs retry from the first step after 5, 15, then every 30 minutes until a completed successful log starting on or after the scheduled time exists, or the deadline passes."}},"required":["type","month","day_of_month","time"]},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["monthly"]},"day_of_month":{"type":"integer","minimum":1,"maximum":31},"time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."},"retry_until":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"Same-day retry deadline for daily, weekly, monthly and yearly schedules, inclusive. Defaults to 23:59. Runs retry from the first step after 5, 15, then every 30 minutes until a completed successful log starting on or after the scheduled time exists, or the deadline passes."}},"required":["type","day_of_month","time"]},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["weekly"]},"day_of_week":{"type":"integer","minimum":0,"maximum":6,"description":"0 = Sunday, 6 = Saturday"},"time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."},"retry_until":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"Same-day retry deadline for daily, weekly, monthly and yearly schedules, inclusive. Defaults to 23:59. Runs retry from the first step after 5, 15, then every 30 minutes until a completed successful log starting on or after the scheduled time exists, or the deadline passes."}},"required":["type","day_of_week","time"]},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["daily"]},"time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."},"retry_until":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"Same-day retry deadline for daily, weekly, monthly and yearly schedules, inclusive. Defaults to 23:59. Runs retry from the first step after 5, 15, then every 30 minutes until a completed successful log starting on or after the scheduled time exists, or the deadline passes."}},"required":["type","time"]},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["hourly"]}},"required":["type"]},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["every_15_minutes"]}},"required":["type"]},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["every_5_minutes"]}},"required":["type"]},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["every_minute"]}},"required":["type"]},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["interval"]},"interval_minutes":{"type":"integer","minimum":1,"maximum":1440},"start_time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."},"stop_time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."}},"required":["type","interval_minutes","start_time","stop_time"]}],"description":"Replaces the schedule when supplied. Defaults to manual on creation. Daily/weekly/monthly/yearly require time and the relevant day/month; interval requires interval_minutes, start_time and stop_time."},"run_as":{"type":"string","maxLength":254,"minLength":1,"pattern":"^(?:[a-fA-F0-9]{24}|[^\\s@,;]+@[^\\s@,;]+\\.[^\\s@,;]+)$","description":"Project member email address (case-insensitive). A user ID is also accepted for compatibility. Responses return the email. Defaults to the authenticated user on creation. Assigning another user requires organization-admin permission."},"notification":{"type":"string","enum":["errors","all"],"default":"errors"},"notification_emails":{"type":"array","items":{"type":"string","maxLength":254,"minLength":1,"pattern":"^[^\\s@,;]+@[^\\s@,;]+\\.[^\\s@,;]+$"},"minItems":0,"maxItems":50,"description":"Empty array disables email delivery. Defaults to empty on creation."},"log_reference":{"type":"string","maxLength":2000,"description":"Supports existing {{tags}}."},"steps":{"type":"array","items":{"oneOf":[{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["http_request"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{"method":{"type":"string","enum":["GET","POST","PUT","DELETE"]},"url":{"type":"string","maxLength":4000,"minLength":1,"pattern":"\\S"},"headers":{"oneOf":[{"type":"string","maxLength":20000},{"type":"object","additionalProperties":{"type":"string"}}],"description":"Header object or JSON-encoded text; supports {{tags}}."},"body":{"oneOf":[{"type":"string","maxLength":200000},{"type":"object","additionalProperties":true},{"type":"array","items":{}}],"description":"JSON object/array or text."},"format":{"type":"string","enum":["json","text","x-www-form-urlencoded","none"],"default":"json"},"output":{"type":"string","maxLength":100,"minLength":1,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z_][A-Za-z0-9_]*$","description":"Output tag name without {{braces}}."}},"required":["method","url","output"]},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"http_request","description":"Make an HTTP request. Text fields support existing {{tags}}."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["code"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","maxLength":200000,"minLength":1,"pattern":"\\S","description":"JavaScript function body; return the native result. Input {{tags}} are substituted as JavaScript literals: strings already include escaped quotes, arrays/objects retain their structure. Use const po = {{purchase_order_number}}; const orders = {{orders}}; Never wrap input tags in quotes or backticks, or JSON.parse them just to undo substitution. For interpolation, assign the tag to a variable first and then build the string. Do not JSON.stringify the return value just to pass it to another step."},"output":{"type":"string","maxLength":100,"minLength":1,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z_][A-Za-z0-9_]*$","description":"Output tag name without {{braces}}."},"format":{"type":"string","enum":["none","json","x-www-form-urlencoded"],"default":"json","description":"Select explicitly from the returned value, not the input. String (none): text, IDs, purchase order numbers, and ID-or-null lookups such as return matchingOrder?._id ?? null;. JSON (json): native objects, arrays, numbers or booleans. x-www-form-urlencoded: deliberately URL-encoded form text needed downstream. A null fallback or JSON input does not make a string result JSON. Review every return path and its downstream use. Output processing only; does not change input tag quoting."}},"required":["code","output"]},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"code","description":"Execute a JavaScript server function in the secure runtime."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["for_each"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{"list":{"type":"string","maxLength":1000,"minLength":1,"pattern":"\\S"},"item":{"type":"string","maxLength":100,"minLength":1,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z_][A-Za-z0-9_]*$","description":"Output tag name without {{braces}}.","default":"item"},"index":{"type":"string","maxLength":100,"minLength":1,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z_][A-Za-z0-9_]*$","description":"Output tag name without {{braces}}.","default":"index"},"max_iterations":{"type":"integer","minimum":1,"maximum":10000,"default":1000},"continue_on_error":{"type":"boolean","default":false},"output":{"type":"string","maxLength":100,"minLength":1,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z_][A-Za-z0-9_]*$","description":"Output tag name without {{braces}}."}},"required":["list"]},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"for_each","description":"Repeat child steps over a list. Children refer to this earlier step by name in parent. The current runner does not support a loop or if as a loop child."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["if_statement"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","maxLength":200000,"minLength":1,"pattern":"\\S"},"output":{"type":"string","maxLength":100,"minLength":1,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z_][A-Za-z0-9_]*$","description":"Output tag name without {{braces}}."}},"required":["code","output"]},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"if_statement","description":"Run condition code returning a boolean. Requires one true and one false child, each referring to this step by name in parent and specifying branch. Keep each branch subtree together in list order."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["log_response"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{"subject":{"type":"string","maxLength":500},"body":{"type":"string","maxLength":20000,"minLength":1,"pattern":"\\S"}},"required":["body"]},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"log_response","description":"Append a response to the task log. Supports {{tags}}."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["send_email"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{"to":{"type":"string","maxLength":2000,"minLength":1,"pattern":"\\S"},"subject":{"type":"string","maxLength":500,"minLength":1,"pattern":"\\S"},"body":{"type":"string","maxLength":20000,"minLength":1,"pattern":"\\S"},"include_email_attachments":{"type":"boolean"}},"required":["to","subject","body"]},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"send_email","description":"Send using the Run as user’s connected mailbox. Supports {{tags}} in recipient, subject and body."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["fetch_email"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{"folder":{"type":"string","maxLength":500,"minLength":1,"pattern":"\\S"},"processed_folder":{"type":"string","maxLength":500,"minLength":1,"pattern":"\\S"},"failed_folder":{"type":"string","maxLength":500},"keyword":{"type":"string","maxLength":500},"sender":{"type":"string","maxLength":500},"recipient":{"type":"string","maxLength":500},"body_keyword":{"type":"string","maxLength":500},"single_file":{"type":"boolean"}},"required":["folder","processed_folder"]},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"fetch_email","description":"Read the Run as user’s connected mailbox. Move processed messages to processed_folder."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["ai_answer"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."},"fields":{"type":"object","additionalProperties":false,"properties":{"prompts":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned instruction ID when editing, including when renaming its output."},"prompt":{"type":"string","maxLength":200000,"minLength":1,"pattern":"\\S"},"output":{"type":"string","maxLength":100,"minLength":1,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z_][A-Za-z0-9_]*$","description":"Output tag name without {{braces}}."},"model":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Exact model name from the model catalog, for example gpt-5.5."},"response":{"type":"string","enum":["string","json","foreach","code","media","task","list"]}},"required":["prompt","output","model","response"]},"minItems":1,"maxItems":100}},"required":["prompts"]}},"required":["type","name","fields"],"title":"ai_answer","description":"Ordered inline AI prompts in fields.prompts. Saved instructions are created automatically."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["ai_answer"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{"question_ids":{"type":"array","items":{"type":"string","pattern":"^[a-fA-F0-9]{24}$"},"minItems":1,"maxItems":100,"description":"Existing instruction (templatequestion) IDs in this project, in execution order. Configure prompt, model, inputs and output on those instructions."}},"required":["question_ids"]},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"ai_answer (instruction IDs)","description":"Compatibility input only. Reads return prompts instead of question_ids."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["ai_agent"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."},"fields":{"type":"object","additionalProperties":false,"properties":{"prompts":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned instruction ID when editing, including when renaming its output."},"prompt":{"type":"string","maxLength":200000,"minLength":1,"pattern":"\\S"},"output":{"type":"string","maxLength":100,"minLength":1,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z_][A-Za-z0-9_]*$","description":"Output tag name without {{braces}}."},"model":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Exact model name from the model catalog, for example gpt-5.5."},"response":{"type":"string","enum":["string","json","foreach","code","media","task","list"]}},"required":["prompt","output","model","response"]},"minItems":1,"maxItems":100}},"required":["prompts"]}},"required":["type","name","fields"],"title":"ai_agent","description":"Ordered inline AI prompts in fields.prompts. Saved instructions are created automatically."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["ai_agent"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{"question_ids":{"type":"array","items":{"type":"string","pattern":"^[a-fA-F0-9]{24}$"},"minItems":1,"maxItems":100,"description":"Existing instruction (templatequestion) IDs in this project, in execution order. Configure prompt, model, inputs and output on those instructions."}},"required":["question_ids"]},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"ai_agent (instruction IDs)","description":"Compatibility input only. Reads return prompts instead of question_ids."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["transcribe_audio"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{"transcriptions":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$"},"model":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S"},"output":{"type":"string","maxLength":100,"minLength":1,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z_][A-Za-z0-9_]*$","description":"Output tag name without {{braces}}."}},"required":["model","output"]},"minItems":1,"maxItems":100}},"required":["transcriptions"]},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"transcribe_audio","description":"Transcribe emailAttachments with fields.transcriptions (model and output). Saved question_ids remain compatibility input."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["transcribe_audio"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{"question_ids":{"type":"array","items":{"type":"string","pattern":"^[a-fA-F0-9]{24}$"},"minItems":0,"maxItems":100,"description":"Compatibility input. Empty list preserves the runtime default transcription."}},"required":["question_ids"]},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"transcribe_audio","description":"Transcribe emailAttachments with fields.transcriptions (model and output). Saved question_ids remain compatibility input."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["end"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{}},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"end","description":"End the task run."},{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$"},"type":{"type":"string","enum":["unsupported"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S"},"description":{"type":"string","maxLength":4000},"fields":{"type":"object","additionalProperties":false,"properties":{}},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S"},"branch":{"type":"string","enum":["true","false"]},"integration_category":{"type":"integer","minimum":0,"maximum":1000}},"required":["id","type","name","fields","integration_category"]}]},"minItems":1,"maxItems":100,"description":"Ordered full replacement when supplied. Omit on update to preserve steps. New tasks require at least one step. Only the documented step types are supported in this draft."}},"required":["name","steps"]},{"type":"object","additionalProperties":false,"properties":{"revision":{"type":"string","maxLength":100,"description":"Opaque revision returned by GET. Include on updates to reject stale edits with 409."},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Omit to create. Supply to update an existing task in this project. Names are not identifiers."},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S"},"active":{"type":"boolean","default":false,"description":"New tasks are inactive by default. Saving does not queue a run."},"schedule":{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["manual","yearly","monthly","weekly","daily","hourly","every_15_minutes","every_5_minutes","every_minute","interval"]},"time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."},"month":{"type":"integer","minimum":1,"maximum":12},"day_of_month":{"type":"integer","minimum":1,"maximum":31},"day_of_week":{"type":"integer","minimum":0,"maximum":6,"description":"0 = Sunday, 6 = Saturday"},"interval_minutes":{"type":"integer","minimum":1,"maximum":1440},"start_time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."},"stop_time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."},"retry_until":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"Same-day retry deadline for daily, weekly, monthly and yearly schedules, inclusive. Defaults to 23:59. Runs retry from the first step after 5, 15, then every 30 minutes until a completed successful log starting on or after the scheduled time exists, or the deadline passes."}},"required":["type"],"oneOf":[{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["manual"]}},"required":["type"]},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["yearly"]},"month":{"type":"integer","minimum":1,"maximum":12},"day_of_month":{"type":"integer","minimum":1,"maximum":31},"time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."},"retry_until":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"Same-day retry deadline for daily, weekly, monthly and yearly schedules, inclusive. Defaults to 23:59. Runs retry from the first step after 5, 15, then every 30 minutes until a completed successful log starting on or after the scheduled time exists, or the deadline passes."}},"required":["type","month","day_of_month","time"]},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["monthly"]},"day_of_month":{"type":"integer","minimum":1,"maximum":31},"time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."},"retry_until":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"Same-day retry deadline for daily, weekly, monthly and yearly schedules, inclusive. Defaults to 23:59. Runs retry from the first step after 5, 15, then every 30 minutes until a completed successful log starting on or after the scheduled time exists, or the deadline passes."}},"required":["type","day_of_month","time"]},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["weekly"]},"day_of_week":{"type":"integer","minimum":0,"maximum":6,"description":"0 = Sunday, 6 = Saturday"},"time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."},"retry_until":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"Same-day retry deadline for daily, weekly, monthly and yearly schedules, inclusive. Defaults to 23:59. Runs retry from the first step after 5, 15, then every 30 minutes until a completed successful log starting on or after the scheduled time exists, or the deadline passes."}},"required":["type","day_of_week","time"]},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["daily"]},"time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."},"retry_until":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"Same-day retry deadline for daily, weekly, monthly and yearly schedules, inclusive. Defaults to 23:59. Runs retry from the first step after 5, 15, then every 30 minutes until a completed successful log starting on or after the scheduled time exists, or the deadline passes."}},"required":["type","time"]},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["hourly"]}},"required":["type"]},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["every_15_minutes"]}},"required":["type"]},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["every_5_minutes"]}},"required":["type"]},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["every_minute"]}},"required":["type"]},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["interval"]},"interval_minutes":{"type":"integer","minimum":1,"maximum":1440},"start_time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."},"stop_time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."}},"required":["type","interval_minutes","start_time","stop_time"]}],"description":"Replaces the schedule when supplied. Defaults to manual on creation. Daily/weekly/monthly/yearly require time and the relevant day/month; interval requires interval_minutes, start_time and stop_time."},"run_as":{"type":"string","maxLength":254,"minLength":1,"pattern":"^(?:[a-fA-F0-9]{24}|[^\\s@,;]+@[^\\s@,;]+\\.[^\\s@,;]+)$","description":"Project member email address (case-insensitive). A user ID is also accepted for compatibility. Responses return the email. Defaults to the authenticated user on creation. Assigning another user requires organization-admin permission."},"notification":{"type":"string","enum":["errors","all"],"default":"errors"},"notification_emails":{"type":"array","items":{"type":"string","maxLength":254,"minLength":1,"pattern":"^[^\\s@,;]+@[^\\s@,;]+\\.[^\\s@,;]+$"},"minItems":0,"maxItems":50,"description":"Empty array disables email delivery. Defaults to empty on creation."},"log_reference":{"type":"string","maxLength":2000,"description":"Supports existing {{tags}}."},"steps":{"type":"array","items":{"oneOf":[{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["http_request"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{"method":{"type":"string","enum":["GET","POST","PUT","DELETE"]},"url":{"type":"string","maxLength":4000,"minLength":1,"pattern":"\\S"},"headers":{"oneOf":[{"type":"string","maxLength":20000},{"type":"object","additionalProperties":{"type":"string"}}],"description":"Header object or JSON-encoded text; supports {{tags}}."},"body":{"oneOf":[{"type":"string","maxLength":200000},{"type":"object","additionalProperties":true},{"type":"array","items":{}}],"description":"JSON object/array or text."},"format":{"type":"string","enum":["json","text","x-www-form-urlencoded","none"],"default":"json"},"output":{"type":"string","maxLength":100,"minLength":1,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z_][A-Za-z0-9_]*$","description":"Output tag name without {{braces}}."}},"required":["method","url","output"]},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"http_request","description":"Make an HTTP request. Text fields support existing {{tags}}."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["code"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","maxLength":200000,"minLength":1,"pattern":"\\S","description":"JavaScript function body; return the native result. Input {{tags}} are substituted as JavaScript literals: strings already include escaped quotes, arrays/objects retain their structure. Use const po = {{purchase_order_number}}; const orders = {{orders}}; Never wrap input tags in quotes or backticks, or JSON.parse them just to undo substitution. For interpolation, assign the tag to a variable first and then build the string. Do not JSON.stringify the return value just to pass it to another step."},"output":{"type":"string","maxLength":100,"minLength":1,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z_][A-Za-z0-9_]*$","description":"Output tag name without {{braces}}."},"format":{"type":"string","enum":["none","json","x-www-form-urlencoded"],"default":"json","description":"Select explicitly from the returned value, not the input. String (none): text, IDs, purchase order numbers, and ID-or-null lookups such as return matchingOrder?._id ?? null;. JSON (json): native objects, arrays, numbers or booleans. x-www-form-urlencoded: deliberately URL-encoded form text needed downstream. A null fallback or JSON input does not make a string result JSON. Review every return path and its downstream use. Output processing only; does not change input tag quoting."}},"required":["code","output"]},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"code","description":"Execute a JavaScript server function in the secure runtime."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["for_each"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{"list":{"type":"string","maxLength":1000,"minLength":1,"pattern":"\\S"},"item":{"type":"string","maxLength":100,"minLength":1,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z_][A-Za-z0-9_]*$","description":"Output tag name without {{braces}}.","default":"item"},"index":{"type":"string","maxLength":100,"minLength":1,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z_][A-Za-z0-9_]*$","description":"Output tag name without {{braces}}.","default":"index"},"max_iterations":{"type":"integer","minimum":1,"maximum":10000,"default":1000},"continue_on_error":{"type":"boolean","default":false},"output":{"type":"string","maxLength":100,"minLength":1,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z_][A-Za-z0-9_]*$","description":"Output tag name without {{braces}}."}},"required":["list"]},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"for_each","description":"Repeat child steps over a list. Children refer to this earlier step by name in parent. The current runner does not support a loop or if as a loop child."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["if_statement"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","maxLength":200000,"minLength":1,"pattern":"\\S"},"output":{"type":"string","maxLength":100,"minLength":1,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z_][A-Za-z0-9_]*$","description":"Output tag name without {{braces}}."}},"required":["code","output"]},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"if_statement","description":"Run condition code returning a boolean. Requires one true and one false child, each referring to this step by name in parent and specifying branch. Keep each branch subtree together in list order."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["log_response"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{"subject":{"type":"string","maxLength":500},"body":{"type":"string","maxLength":20000,"minLength":1,"pattern":"\\S"}},"required":["body"]},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"log_response","description":"Append a response to the task log. Supports {{tags}}."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["send_email"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{"to":{"type":"string","maxLength":2000,"minLength":1,"pattern":"\\S"},"subject":{"type":"string","maxLength":500,"minLength":1,"pattern":"\\S"},"body":{"type":"string","maxLength":20000,"minLength":1,"pattern":"\\S"},"include_email_attachments":{"type":"boolean"}},"required":["to","subject","body"]},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"send_email","description":"Send using the Run as user’s connected mailbox. Supports {{tags}} in recipient, subject and body."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["fetch_email"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{"folder":{"type":"string","maxLength":500,"minLength":1,"pattern":"\\S"},"processed_folder":{"type":"string","maxLength":500,"minLength":1,"pattern":"\\S"},"failed_folder":{"type":"string","maxLength":500},"keyword":{"type":"string","maxLength":500},"sender":{"type":"string","maxLength":500},"recipient":{"type":"string","maxLength":500},"body_keyword":{"type":"string","maxLength":500},"single_file":{"type":"boolean"}},"required":["folder","processed_folder"]},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"fetch_email","description":"Read the Run as user’s connected mailbox. Move processed messages to processed_folder."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["ai_answer"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."},"fields":{"type":"object","additionalProperties":false,"properties":{"prompts":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned instruction ID when editing, including when renaming its output."},"prompt":{"type":"string","maxLength":200000,"minLength":1,"pattern":"\\S"},"output":{"type":"string","maxLength":100,"minLength":1,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z_][A-Za-z0-9_]*$","description":"Output tag name without {{braces}}."},"model":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Exact model name from the model catalog, for example gpt-5.5."},"response":{"type":"string","enum":["string","json","foreach","code","media","task","list"]}},"required":["prompt","output","model","response"]},"minItems":1,"maxItems":100}},"required":["prompts"]}},"required":["type","name","fields"],"title":"ai_answer","description":"Ordered inline AI prompts in fields.prompts. Saved instructions are created automatically."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["ai_answer"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{"question_ids":{"type":"array","items":{"type":"string","pattern":"^[a-fA-F0-9]{24}$"},"minItems":1,"maxItems":100,"description":"Existing instruction (templatequestion) IDs in this project, in execution order. Configure prompt, model, inputs and output on those instructions."}},"required":["question_ids"]},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"ai_answer (instruction IDs)","description":"Compatibility input only. Reads return prompts instead of question_ids."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["ai_agent"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."},"fields":{"type":"object","additionalProperties":false,"properties":{"prompts":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned instruction ID when editing, including when renaming its output."},"prompt":{"type":"string","maxLength":200000,"minLength":1,"pattern":"\\S"},"output":{"type":"string","maxLength":100,"minLength":1,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z_][A-Za-z0-9_]*$","description":"Output tag name without {{braces}}."},"model":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Exact model name from the model catalog, for example gpt-5.5."},"response":{"type":"string","enum":["string","json","foreach","code","media","task","list"]}},"required":["prompt","output","model","response"]},"minItems":1,"maxItems":100}},"required":["prompts"]}},"required":["type","name","fields"],"title":"ai_agent","description":"Ordered inline AI prompts in fields.prompts. Saved instructions are created automatically."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["ai_agent"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{"question_ids":{"type":"array","items":{"type":"string","pattern":"^[a-fA-F0-9]{24}$"},"minItems":1,"maxItems":100,"description":"Existing instruction (templatequestion) IDs in this project, in execution order. Configure prompt, model, inputs and output on those instructions."}},"required":["question_ids"]},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"ai_agent (instruction IDs)","description":"Compatibility input only. Reads return prompts instead of question_ids."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["transcribe_audio"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{"transcriptions":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$"},"model":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S"},"output":{"type":"string","maxLength":100,"minLength":1,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z_][A-Za-z0-9_]*$","description":"Output tag name without {{braces}}."}},"required":["model","output"]},"minItems":1,"maxItems":100}},"required":["transcriptions"]},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"transcribe_audio","description":"Transcribe emailAttachments with fields.transcriptions (model and output). Saved question_ids remain compatibility input."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["transcribe_audio"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{"question_ids":{"type":"array","items":{"type":"string","pattern":"^[a-fA-F0-9]{24}$"},"minItems":0,"maxItems":100,"description":"Compatibility input. Empty list preserves the runtime default transcription."}},"required":["question_ids"]},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"transcribe_audio","description":"Transcribe emailAttachments with fields.transcriptions (model and output). Saved question_ids remain compatibility input."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["end"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{}},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"end","description":"End the task run."},{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$"},"type":{"type":"string","enum":["unsupported"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S"},"description":{"type":"string","maxLength":4000},"fields":{"type":"object","additionalProperties":false,"properties":{}},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S"},"branch":{"type":"string","enum":["true","false"]},"integration_category":{"type":"integer","minimum":0,"maximum":1000}},"required":["id","type","name","fields","integration_category"]}]},"minItems":0,"maxItems":100,"description":"Ordered full replacement when supplied. Omit on update to preserve steps. New tasks require at least one step. Only the documented step types are supported in this draft."},"step_updates":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$"},"description":{"type":"string","maxLength":4000},"fields":{"type":"object","additionalProperties":true}},"required":["id"]},"minItems":1,"maxItems":100,"description":"Content updates by existing step ID. Requires revision; cannot accompany steps. Omitted fields are preserved. fields merges by top-level field name; nested objects and arrays replace their field in full. Cannot add, remove, reorder, rename or change step types or branches. The merged steps are validated before saving."}},"required":["id"],"minProperties":2,"anyOf":[{"required":["name"]},{"required":["active"]},{"required":["schedule"]},{"required":["run_as"]},{"required":["notification"]},{"required":["notification_emails"]},{"required":["log_reference"]},{"required":["steps"]},{"required":["step_updates"]}]}],"description":"Without id: create schema. With id: update schema. Validation accepts the same contract."},"schedule_schema":{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["manual","yearly","monthly","weekly","daily","hourly","every_15_minutes","every_5_minutes","every_minute","interval"]},"time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."},"month":{"type":"integer","minimum":1,"maximum":12},"day_of_month":{"type":"integer","minimum":1,"maximum":31},"day_of_week":{"type":"integer","minimum":0,"maximum":6,"description":"0 = Sunday, 6 = Saturday"},"interval_minutes":{"type":"integer","minimum":1,"maximum":1440},"start_time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."},"stop_time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."},"retry_until":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"Same-day retry deadline for daily, weekly, monthly and yearly schedules, inclusive. Defaults to 23:59. Runs retry from the first step after 5, 15, then every 30 minutes until a completed successful log starting on or after the scheduled time exists, or the deadline passes."}},"required":["type"],"oneOf":[{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["manual"]}},"required":["type"]},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["yearly"]},"month":{"type":"integer","minimum":1,"maximum":12},"day_of_month":{"type":"integer","minimum":1,"maximum":31},"time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."},"retry_until":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"Same-day retry deadline for daily, weekly, monthly and yearly schedules, inclusive. Defaults to 23:59. Runs retry from the first step after 5, 15, then every 30 minutes until a completed successful log starting on or after the scheduled time exists, or the deadline passes."}},"required":["type","month","day_of_month","time"]},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["monthly"]},"day_of_month":{"type":"integer","minimum":1,"maximum":31},"time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."},"retry_until":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"Same-day retry deadline for daily, weekly, monthly and yearly schedules, inclusive. Defaults to 23:59. Runs retry from the first step after 5, 15, then every 30 minutes until a completed successful log starting on or after the scheduled time exists, or the deadline passes."}},"required":["type","day_of_month","time"]},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["weekly"]},"day_of_week":{"type":"integer","minimum":0,"maximum":6,"description":"0 = Sunday, 6 = Saturday"},"time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."},"retry_until":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"Same-day retry deadline for daily, weekly, monthly and yearly schedules, inclusive. Defaults to 23:59. Runs retry from the first step after 5, 15, then every 30 minutes until a completed successful log starting on or after the scheduled time exists, or the deadline passes."}},"required":["type","day_of_week","time"]},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["daily"]},"time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."},"retry_until":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"Same-day retry deadline for daily, weekly, monthly and yearly schedules, inclusive. Defaults to 23:59. Runs retry from the first step after 5, 15, then every 30 minutes until a completed successful log starting on or after the scheduled time exists, or the deadline passes."}},"required":["type","time"]},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["hourly"]}},"required":["type"]},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["every_15_minutes"]}},"required":["type"]},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["every_5_minutes"]}},"required":["type"]},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["every_minute"]}},"required":["type"]},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["interval"]},"interval_minutes":{"type":"integer","minimum":1,"maximum":1440},"start_time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."},"stop_time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."}},"required":["type","interval_minutes","start_time","stop_time"]}]},"schema_authority":"task_schema is the create/update oneOf contract. schedule_schema is authoritative; schedule_types is a readable index of the same variants. Calendar validity and interval stop_time > start_time are checked by POST /api/v1/tasks/validate; schema alone cannot compare these values.","integrations":[{"type":"http_request","integration_category":13,"deprecated":false,"aliasOf":null,"description":"Make an HTTP request. Text fields support existing {{tags}}.","notes":"Prefer an object for headers. For JSON requests use format: \"json\" and an object or array body. JSON-encoded strings remain accepted. output names the result used by later {{tags}}.","fields_schema":{"type":"object","additionalProperties":false,"properties":{"method":{"type":"string","enum":["GET","POST","PUT","DELETE"]},"url":{"type":"string","maxLength":4000,"minLength":1,"pattern":"\\S"},"headers":{"oneOf":[{"type":"string","maxLength":20000},{"type":"object","additionalProperties":{"type":"string"}}],"description":"Header object or JSON-encoded text; supports {{tags}}."},"body":{"oneOf":[{"type":"string","maxLength":200000},{"type":"object","additionalProperties":true},{"type":"array","items":{}}],"description":"JSON object/array or text."},"format":{"type":"string","enum":["json","text","x-www-form-urlencoded","none"],"default":"json"},"output":{"type":"string","maxLength":100,"minLength":1,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z_][A-Za-z0-9_]*$","description":"Output tag name without {{braces}}."}},"required":["method","url","output"]},"example":{"type":"http_request","name":"Fetch orders","description":"","fields":{"method":"GET","url":"https://example.com/orders","headers":{"Accept":"application/json"},"output":"orders"}}},{"type":"code","integration_category":29,"deprecated":false,"aliasOf":null,"description":"Execute a JavaScript server function in the secure runtime.","notes":"code is the JavaScript function body. Return the native result to store it under output. Input tags are JavaScript literals, including escaped quotes for strings: use const po = {{purchase_order_number}}; const orders = {{orders}}; Do not surround tags with quotes or backticks, strip quotes, or JSON.parse values just to undo substitution. Assign tags to variables before building strings. Output options are String (format: \"none\"), JSON (format: \"json\"), and x-www-form-urlencoded (format: \"x-www-form-urlencoded\"). For a constant use return \"SWM948681\"; with format: \"none\". Use format: \"json\" for objects/arrays. format controls output processing, not input tag quoting.","fields_schema":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","maxLength":200000,"minLength":1,"pattern":"\\S","description":"JavaScript function body; return the native result. Input {{tags}} are substituted as JavaScript literals: strings already include escaped quotes, arrays/objects retain their structure. Use const po = {{purchase_order_number}}; const orders = {{orders}}; Never wrap input tags in quotes or backticks, or JSON.parse them just to undo substitution. For interpolation, assign the tag to a variable first and then build the string. Do not JSON.stringify the return value just to pass it to another step."},"output":{"type":"string","maxLength":100,"minLength":1,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z_][A-Za-z0-9_]*$","description":"Output tag name without {{braces}}."},"format":{"type":"string","enum":["none","json","x-www-form-urlencoded"],"default":"json","description":"Select explicitly from the returned value, not the input. String (none): text, IDs, purchase order numbers, and ID-or-null lookups such as return matchingOrder?._id ?? null;. JSON (json): native objects, arrays, numbers or booleans. x-www-form-urlencoded: deliberately URL-encoded form text needed downstream. A null fallback or JSON input does not make a string result JSON. Review every return path and its downstream use. Output processing only; does not change input tag quoting."}},"required":["code","output"]},"example":{"type":"code","name":"Prepare orders","description":"","fields":{"code":"return [{ number: \"PO1001\" }];","output":"orders","format":"json"}}},{"type":"for_each","integration_category":30,"deprecated":false,"aliasOf":null,"description":"Repeat child steps over a list. Children refer to this earlier step by name in parent. The current runner does not support a loop or if as a loop child.","notes":"This step needs at least one following child with parent set to this step’s name. Loop children must be contiguous. Nested loops and if statements inside loops are not supported by the current runner.","fields_schema":{"type":"object","additionalProperties":false,"properties":{"list":{"type":"string","maxLength":1000,"minLength":1,"pattern":"\\S"},"item":{"type":"string","maxLength":100,"minLength":1,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z_][A-Za-z0-9_]*$","description":"Output tag name without {{braces}}.","default":"item"},"index":{"type":"string","maxLength":100,"minLength":1,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z_][A-Za-z0-9_]*$","description":"Output tag name without {{braces}}.","default":"index"},"max_iterations":{"type":"integer","minimum":1,"maximum":10000,"default":1000},"continue_on_error":{"type":"boolean","default":false},"output":{"type":"string","maxLength":100,"minLength":1,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z_][A-Za-z0-9_]*$","description":"Output tag name without {{braces}}."}},"required":["list"]},"example":{"type":"for_each","name":"Each order","description":"","fields":{"list":"orders","item":"order","index":"orderIndex","max_iterations":1000,"continue_on_error":false,"output":"orderResults"}}},{"type":"if_statement","integration_category":31,"deprecated":false,"aliasOf":null,"description":"Run condition code returning a boolean. Requires one true and one false child, each referring to this step by name in parent and specifying branch. Keep each branch subtree together in list order.","notes":"This step needs exactly one true child and one false child. Each child uses parent and branch (\"true\" or \"false\" as strings). A branch can be a loop or another if. Keep each branch subtree together.","fields_schema":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","maxLength":200000,"minLength":1,"pattern":"\\S"},"output":{"type":"string","maxLength":100,"minLength":1,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z_][A-Za-z0-9_]*$","description":"Output tag name without {{braces}}."}},"required":["code","output"]},"example":{"type":"if_statement","name":"Has orders","description":"","fields":{"code":"return {{orders}}.length > 0;","output":"hasOrders"}}},{"type":"log_response","integration_category":15,"deprecated":false,"aliasOf":null,"description":"Append a response to the task log. Supports {{tags}}.","notes":"Text can reference earlier results using {{outputName}}.","fields_schema":{"type":"object","additionalProperties":false,"properties":{"subject":{"type":"string","maxLength":500},"body":{"type":"string","maxLength":20000,"minLength":1,"pattern":"\\S"}},"required":["body"]},"example":{"type":"log_response","name":"Record result","description":"","fields":{"subject":"Order results","body":"{{matchedProducts}}"}}},{"type":"send_email","integration_category":9,"deprecated":false,"aliasOf":null,"description":"Send using the Run as user’s connected mailbox. Supports {{tags}} in recipient, subject and body.","notes":"Uses the run_as user’s connected mailbox. Mail permissions must already be configured for that user.","fields_schema":{"type":"object","additionalProperties":false,"properties":{"to":{"type":"string","maxLength":2000,"minLength":1,"pattern":"\\S"},"subject":{"type":"string","maxLength":500,"minLength":1,"pattern":"\\S"},"body":{"type":"string","maxLength":20000,"minLength":1,"pattern":"\\S"},"include_email_attachments":{"type":"boolean"}},"required":["to","subject","body"]},"example":{"type":"send_email","name":"Email result","description":"","fields":{"to":"ops@example.com","subject":"Order results","body":"{{matchedProducts}}","include_email_attachments":false}}},{"type":"fetch_email","integration_category":10,"deprecated":false,"aliasOf":null,"description":"Read the Run as user’s connected mailbox. Move processed messages to processed_folder.","notes":"Uses the run_as user’s connected mailbox. Use folder names or paths recognized by that mailbox. Processed messages move to processed_folder.","fields_schema":{"type":"object","additionalProperties":false,"properties":{"folder":{"type":"string","maxLength":500,"minLength":1,"pattern":"\\S"},"processed_folder":{"type":"string","maxLength":500,"minLength":1,"pattern":"\\S"},"failed_folder":{"type":"string","maxLength":500},"keyword":{"type":"string","maxLength":500},"sender":{"type":"string","maxLength":500},"recipient":{"type":"string","maxLength":500},"body_keyword":{"type":"string","maxLength":500},"single_file":{"type":"boolean"}},"required":["folder","processed_folder"]},"example":{"type":"fetch_email","name":"Read orders","description":"","fields":{"folder":"Inbox","processed_folder":"Processed","failed_folder":"Failed","keyword":"Order","single_file":false}}},{"type":"ai_answer","integration_category":33,"deprecated":false,"aliasOf":null,"description":"Direct AI answers; uses answer context by default.","notes":"Use an exact model from GET /api/v1/tasks/authoring-options. fields.prompts contains prompt, output, model and response. Retain returned step and prompt IDs to preserve hidden settings across renames. Edited shared instructions are copied, not modified. question_ids is compatibility input only; new AI steps do not need instruction IDs. These types share a shape but are not interchangeable aliases.","fields_schema":{"type":"object","additionalProperties":false,"properties":{"prompts":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned instruction ID when editing, including when renaming its output."},"prompt":{"type":"string","maxLength":200000,"minLength":1,"pattern":"\\S"},"output":{"type":"string","maxLength":100,"minLength":1,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z_][A-Za-z0-9_]*$","description":"Output tag name without {{braces}}."},"model":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Exact model name from the model catalog, for example gpt-5.5."},"response":{"type":"string","enum":["string","json","foreach","code","media","task","list"]}},"required":["prompt","output","model","response"]},"minItems":1,"maxItems":100}},"required":["prompts"]},"example":{"type":"ai_answer","name":"Match to product codes","description":"","fields":{"prompts":[{"prompt":"Match the order lines to product codes in {{priceList}}. Return JSON.","output":"matchedProducts","model":"gpt-5.5","response":"json"}]}}},{"type":"ai_agent","integration_category":34,"deprecated":false,"aliasOf":null,"description":"Recommended for new agent tasks; uses agent context by default.","notes":"Use an exact model from GET /api/v1/tasks/authoring-options. fields.prompts contains prompt, output, model and response. Retain returned step and prompt IDs to preserve hidden settings across renames. Edited shared instructions are copied, not modified. question_ids is compatibility input only; new AI steps do not need instruction IDs. These types share a shape but are not interchangeable aliases.","fields_schema":{"type":"object","additionalProperties":false,"properties":{"prompts":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned instruction ID when editing, including when renaming its output."},"prompt":{"type":"string","maxLength":200000,"minLength":1,"pattern":"\\S"},"output":{"type":"string","maxLength":100,"minLength":1,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z_][A-Za-z0-9_]*$","description":"Output tag name without {{braces}}."},"model":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Exact model name from the model catalog, for example gpt-5.5."},"response":{"type":"string","enum":["string","json","foreach","code","media","task","list"]}},"required":["prompt","output","model","response"]},"minItems":1,"maxItems":100}},"required":["prompts"]},"example":{"type":"ai_agent","name":"Match to product codes","description":"","fields":{"prompts":[{"prompt":"Match the order lines to product codes in {{priceList}}. Return JSON.","output":"matchedProducts","model":"gpt-5.5","response":"json"}]}}},{"type":"transcribe_audio","integration_category":18,"deprecated":false,"aliasOf":null,"description":"Transcribe emailAttachments with fields.transcriptions (model and output). Saved question_ids remain compatibility input.","notes":"Use fields.transcriptions with model and output for each transcription. Models must have type 3 in authoring-options. Reads include instruction IDs: retain these on edits. Consumes audio in emailAttachments and returns text under output, plus outputQuality. question_ids is compatibility input only; new steps do not need instruction IDs.","fields_schema":{"type":"object","additionalProperties":false,"properties":{"transcriptions":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$"},"model":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S"},"output":{"type":"string","maxLength":100,"minLength":1,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z_][A-Za-z0-9_]*$","description":"Output tag name without {{braces}}."}},"required":["model","output"]},"minItems":1,"maxItems":100}},"required":["transcriptions"]},"example":{"type":"transcribe_audio","name":"Transcribe voicemail","description":"","fields":{"transcriptions":[{"model":"whisper-1","output":"audioTranscription"}]}}},{"type":"end","integration_category":32,"deprecated":false,"aliasOf":null,"description":"End the task run.","notes":"fields must be an empty object. This ends the whole task run, including when it is used inside a loop.","fields_schema":{"type":"object","additionalProperties":false,"properties":{}},"example":{"type":"end","name":"Finish","description":"","fields":{}}}],"task_example":{"name":"Process order list","active":false,"schedule":{"type":"manual"},"run_as":"user@example.com","notification":"errors","notification_emails":["ops@example.com"],"log_reference":"Order processing","steps":[{"type":"code","name":"Prepare orders","fields":{"code":"return [{ number: \"PO1001\" }];","output":"orders","format":"json"}},{"type":"if_statement","name":"Has orders","fields":{"code":"return {{orders}}.length > 0;","output":"hasOrders"}},{"type":"for_each","name":"Each order","parent":"Has orders","branch":"true","fields":{"list":"orders","item":"order","index":"orderIndex","max_iterations":1000,"continue_on_error":false,"output":"orderResults"}},{"type":"log_response","name":"Record order","parent":"Each order","fields":{"body":"{{order.number}}"}},{"type":"log_response","name":"No orders","parent":"Has orders","branch":"false","fields":{"body":"No orders to process."}}]}}