Create Instance For Job Type
createInstanceForJobTypeFull Description
Creates a new record instance for any confirmed record type.
════════════════════════════════════════════════════════════ CALL THIS TOOL ONLY AFTER: ════════════════════════════════════════════════════════════ 1. retrieveAllJobTypes → record type confirmed 2. getMandatoryFieldsOfJobType → fields retrieved 3. All non-file field values collected from user 4. Values mapped to exact allowed options (for Selection fields) 5. Confirmation summary shown to user in plain English 6. User explicitly confirmed 7. File/Attachment fields collected one at a time with per-file confirmation 8. fileFieldMappings built from confirmed attachments 9. parentJobInstanceId resolved from SESSION STACK (for sub-records only)
════════════════════════════════════════════════════════════ DATA OBJECT RULES ════════════════════════════════════════════════════════════ The "data" object must use EXACT backend field names as keys (from getMandatoryFieldsOfJobType). Values for Selection fields must be an exact allowed value. Values for Text / Number / Date fields use the user's input directly. File / Attachment fields are NOT included in "data" — they are handled via openaiFileIdRefs and fileFieldMappings by the controller layer.
════════════════════════════════════════════════════════════ PARENT-CHILD LINKAGE ════════════════════════════════════════════════════════════ When creating a child record (sub-job): → Include "parentJobInstanceId" = STACK_TOP.instanceId → Read this value from the SESSION STACK only — never from conversation history → Never guess or assume this value
When creating a root record (no parent): → DO NOT include "parentJobInstanceId" at all — omit it entirely
The response will echo back ParentJobInstanceId in response[0] when it was sent correctly.
════════════════════════════════════════════════════════════ LOOP PREVENTION ════════════════════════════════════════════════════════════ ✔ Call this tool exactly once per record type per creation flow ✗ Do NOT call getMandatoryFieldsOfJobType again after fields are collected ✗ Do NOT ask for the same fields again ✗ Do NOT restart the flow after calling this tool
Parameters (3 required, 3 optional)
dataobjectAll non-file mandatory and optional field values keyed by EXACT backend field names. File/Attachment fields are populated automatically by the controller and must not be set here.
jobTypeIdstringJob type ID from retrieveAllJobTypes
jobTypeNamestringExact backend job type name
fileFieldMappingsarrayMaps each openaiFileIdRefs entry by zero-based index to an exact backend field key.
openaiFileIdRefsarrayFile references populated by ChatGPT at runtime.
parentJobInstanceIdstringRequired for child records only. Must be the exact InstanceId from the parent record's createInstanceForJobType response[0].InstanceId, read from the SESSION STACK. Omit entirely for root-level records.