Hi,
we changed the default behaviour of the job "Validate formats" to stop ingests on validation errors by editing the JSON-encoded workflow of the instance itself.
File path (in AM 1.18): /opt/archivematica/archivematica/src/archivematica/MCPServer/assets/workflow.json
Maybe something similar can be achieved with the job "Identify file format" or another custom command that provides a stable exit code for your error case?
More details:
--- workflow.json 2025-02-11 15:53:47.617974670 +0100
+++ workflow.fail-on_validation-error.json 2025-02-14 17:19:34.887327388 +0100
@@ -8109,10 +8109,14 @@
"0": {
"job_status": "Completed successfully",
"link_id": "ec3c965c-c056-47e3-a551-ad1966e00824"
+ },
+ "1": {
+ "job_status": "Failed",
+ "link_id": "61c316a6-0a50-4f65-8767-1f44b1eeb6dd"
}
},
"fallback_job_status": "Failed",
- "fallback_link_id": "ec3c965c-c056-47e3-a551-ad1966e00824",
+ "fallback_link_id": "61c316a6-0a50-4f65-8767-1f44b1eeb6dd",
"group": {
"en": "Validation",
"es": "Validación",
- links the validation job return value "1" as well as the fallback to job "Email fail report" instead of the next regular job
- job "Email fail report" seems to start the chain for failed transfers

Best regards,
Jens Steidl
team member SLUBArchiv.digital | digital long-term preservation
Saxon State and University Library Dresden (SLUB)