{"name":"Prooftask · prepare-job","nodes":[{"id":"pt-continuity-0","name":"Run deliberately","type":"n8n-nodes-base.manualTrigger","typeVersion":1,"position":[0,0],"parameters":{}},{"id":"pt-continuity-1","name":"Input","type":"n8n-nodes-base.code","typeVersion":2,"position":[260,0],"parameters":{"jsCode":"return [{json:{\"requestId\":\"PERSIST_ONE_UUID_V4_PER_INTENDED_DELIVERY\",\"projectId\":\"EXACT_PROJECT_ID\",\"workflowReference\":\"crm:job-001\",\"summary\":\"The mapped delivery is ready for review.\",\"materials\":[{\"criterionId\":\"AGREED_CRITERION_ID\",\"summary\":\"Description of the actual original materials.\",\"references\":[\"https://example.com/original\"],\"files\":[]}]}}];"},"notes":"Map the existing job ID and actual materials here. Preserve requestId when retrying preparation.","notesInFlow":true},{"id":"pt-continuity-2","name":"Validate one job","type":"n8n-nodes-base.code","typeVersion":2,"position":[520,0],"parameters":{"jsCode":"if($input.all().length!==1)throw new Error('ONE_JOB_REQUIRED');const v=$input.first().json;if(!/^[a-f0-9-]{36}$/.test(v.requestId)||!/^delivery_[a-f0-9-]{36}$/.test(v.projectId))throw new Error('EXACT_IDS_REQUIRED');return [{json:v}];"}},{"id":"pt-continuity-3","name":"Prepare and persist request","type":"n8n-nodes-base.httpRequest","typeVersion":4.2,"position":[780,0],"parameters":{"authentication":"genericCredentialType","genericAuthType":"httpHeaderAuth","options":{"allowUnauthorizedCerts":false,"redirect":{"redirect":{"followRedirects":false,"maxRedirects":0}},"response":{"response":{"responseFormat":"json","neverError":false}},"timeout":20000},"method":"POST","url":"https://prooftask.com/api/agents/v1/jobs","sendBody":true,"contentType":"json","specifyBody":"json","jsonBody":"={{ JSON.stringify($json) }}"},"notes":"Select a Header Auth credential: Authorization = Bearer <scoped agent token>. Do not put tokens in workflow inputs or exports.","notesInFlow":true}],"connections":{"Run deliberately":{"main":[[{"node":"Input","type":"main","index":0}]]},"Input":{"main":[[{"node":"Validate one job","type":"main","index":0}]]},"Validate one job":{"main":[[{"node":"Prepare and persist request","type":"main","index":0}]]}},"active":false,"settings":{"executionOrder":"v1","saveDataSuccessExecution":"none","saveDataErrorExecution":"none","saveManualExecutions":false},"pinData":{},"tags":[]}