agent cannot parse audience export with invalid filters: parsing failed with error and the workflow broke
Fixes a workflow that breaks because the agent cannot parse a audience export with invalid filters, by adding schema validation and a repair or reject path at intake. Use when malformed input files keep reaching the agent and breaking runs. Not for a one off hand written file the owner can simply correct.
TL;DR
Move the failure to the front door. Validate every audience export at intake against an explicit schema, report the invalid filters in plain language to whoever supplied the file, and let the agent start only on files that pass. A workflow that discovers bad input at step nine of ten wastes the whole run, while an intake check turns the same defect into a thirty second correction.
agent cannot parse audience export with invalid filters: parsing failed with error and the workflow brokeUse this when
- An agent run stops at intake or early in the build with a parse error naming the audience export.
- Inspecting the file shows invalid filters that a human can spot once they are listed.
- The same class of malformed file has broken more than one run.
Not for this skill when
- The file parses and the Superset REST API rejects the resulting dashboard. That is an API validation problem, not a parse failure.
- The file is generated by the agent itself in the same run. Fix the generator step rather than the parser.
Steps
- Reproduce the failure locally by loading the exact audience export from the failed run with the same parser the agent uses. Verify: the local load fails with the same error the run recorded
- Run a structural check over the file that lists the invalid filters explicitly, with locations, instead of stopping at the first defect. Verify: the check outputs a complete defect list for the file
- Repair the file at the source, correcting each listed defect, or return the defect list to the file owner if the right values are a business decision. Verify: the repaired file passes the structural check with no defects
- Add a preflight validation step to the agent that runs the check before any API call and fails the run with the defect list attached. Verify: a deliberately broken test file fails in preflight with a readable report
- Define the expected file shape as an explicit schema, covering required entries, allowed names and value types, and version it with the agent. Verify: the schema rejects a file with invalid filters and accepts the repaired file
- Rerun the original task with the repaired file and confirm the agent completes the Superset build. Verify: the run finishes and the dashboard reflects the file contents
Why it happens
Parser failures at intake are data quality problems arriving through a file. Because the agent is the first strict reader the file ever meets, every latent defect in hand maintained files surfaces there first. Treating the file as an untrusted input, with a schema, a full defect report and a reject path, converts a recurring run breaker into ordinary input hygiene. The agent code rarely needs to change at all once the intake is honest.
The agent pipeline reads the audience export to decide what to build in Superset, which fields and metrics to use, and how to lay the result out. Parsers in agent code are usually written against the happy path shape of the file, so invalid filters produce confusing low level errors or silent misreads rather than a clear intake report. The run then fails with a parser stack trace that names the library, not the actual defect in the file, which sends debugging in the wrong direction.
Operational notes for input file failures in agent pipelines. Keep a golden set of example files, one per supported shape, in the repository with the agent, and run the parser against them in testing whenever the parser changes. Most parser regressions are discovered by users because the happy path file in the test set was the only shape ever tested. Add one deliberately broken file per known defect class to the same set, with the expected defect report written down, so the intake validation is tested as a feature and not just as a hope.
Variants and edge cases
parser failed audience export invalid filters agent run
The near verbatim phrasing from the run failure.
validate audience export schema before agent build preflight
The prevention variant focused on intake validation.
agent cannot parse audience export defect list repair
The reporting variant where the parser must explain the defects.
Provenance
Resolved from the public thread: https://vectle.com/posts/pst_bllDZeSD3eXgGv34UvlyoA