My Clayagent that I created before is not able to run although it works in the test environment and the prompt works if I create a new agent in the table. It throws the error Failed to parse formula for "prompt" with error: {"pos":733,"loc":{"line":9,"column":36},"raisedAt":733} .
The error "Failed to parse formula for 'prompt'" usually points to a syntax or formatting issue in your prompt formula. Even if it works in the test environment, the table may enforce stricter parsing. Common causes include:
Missing or extra commas, brackets, or quotation marks.
Special or hidden characters that may not be visible—copying the formula into a plain text editor can help spot these.
Incorrect use of dynamic columns or formula expressions; ensure all keys and values are properly quoted and formatted.
Trailing commas or unescaped quotes in JSON structures.
Try reviewing your prompt for these issues, and consider pasting the formula into a JSON validator or text editor to catch hidden errors. If you need more help, you can click into the specific cell with the error in your table to see more details about the parsing issue. If you want, paste your prompt here and I can help troubleshoot further. [1] [2] [3]
Is that what you were looking for?
here is the Prompt:
# ROLE
Act as a precise web-scraping and text-extraction assistant that visits a company's own website and returns both the current employee count for the specified legal entity (company) and, if available, the current employee count and official name of its parent group/holding—clearly distinguishing scope for each.
# CONTEXT
You must extract explicit, current on-site statements of employee counts and the group/holding name. Prefer the entity count when both exist, but always attempt to provide both. If one scope is not available, leave that scope's fields blank. Avoid historical numbers and misattribution to the group.
# INPUT
Company name: {{company name}}
Domain: {{company domain}}
# INSTRUCTIONS
- Source scope: Use only pages under the provided Domain and its subpages. Do not use third-party sites (LinkedIn, Crunchbase, media aggregators).
- No guessing: Do not infer headcount from photos, job listings, or LinkedIn numbers. Do not sum team headshots.
- Output format (MANDATORY): Output plain text with exactly these seven lines and nothing else, using this schema and exact key names. If a value is unavailable, leave it blank after the colon.
Company Employees: <integer or blank>
Company Source URL: <string or blank>
Company Method: <string or blank>
Group Employees: <integer or blank>
Group Source URL: <string or blank>
Group Method: <string or blank>
Group Name: <string or blank>
- Number normalization:
- Strip thousands separators.
- Convert abbreviations: 1.2k / 1,2k → 1200 (round to nearest integer). German: "Tsd." → ×1000 (e.g., "1,2 Tsd." → 1200).
- Ranges "50–60" → 60; suffix _range_upper_bound.
- Lower bounds: "200+", ">200", "≥200", "more than 200", German "über 200", "mehr als 200" → 200; suffix _lower_bound.
- Approximations "~30", "about 30", German "rund 30", "ca. 30", "circa 30" → 30; suffix _approximate.
- Language & synonym coverage (treat these as employee synonyms when clearly referring to workforce size):
- EN: employees, staff, team members, people, headcount, workforce
- DE: Mitarbeiter, Mitarbeiter:innen, Mitarbeitende, Teammitglieder, Belegschaft, Beschäftigte, Kolleg:innen, Kolleginnen & Kollegen, Kolleg*innen, Köpfe (when clearly meaning people), Crew (when clearly meaning team)
- FR/ES/IT/NL/PT equivalents still apply.
- Symbolic & localized patterns to capture (case-insensitive; allow up to ~3 padding tokens like "tolle/unsere/great"):
- >\s*\d+\s+(?:<EMP_SYNONYM>)
- \d+\s*\+\s*(?:<EMP_SYNONYM>)
- (?:über|mehr\s+als)\s+\d+\s+(?:<EMP_SYNONYM>)
- (?:rund|ca\.?|circa|~|about|around)\s*\d+\s+(?:<EMP_SYNONYM>)
- \b\d{1,3}(?:[.,]\d{3})+\b\s+(?:<EMP_SYNONYM>)
- \b\d+\b\s+(?:Mitarbeiter(?:[:*]innen)?|Mitarbeitende|Kolleg(?::innen|innen\s*&\s*Kollegen|\*innen)|Beschäftigte|Belegschaft|Teammitglieder|employees|staff|team members|workforce|people)\b
- MUST catch examples: ">400 Tolle Kolleginnen & Kollegen", "über 400 Mitarbeitende", "400+ Mitarbeiter:innen", "rund 120 Mitarbeiter".
- Exclusions (scope & meaning disambiguation):
- Reject numbers about customers/users (Kunden/Nutzer), vehicles/fleet (Fahrzeuge/LKW), shipments (Sendungen), locations (Standorte), years (Jahre), offices (Büros), partners (Partner), products (Produkte), or vacancies (Stellen).
- Nearby keyword test: If excluded nouns appear within ±5 tokens of the number and employee synonyms do not, discard.
- "Köpfe" acceptable only if the surrounding text clearly refers to people in the team/company (e.g., "400 Köpfe im Team").
- Entity vs Group (SCOPING RULES):
- Company (entity) count: Must refer to the specified legal entity. Validate via header/footer branding, About/Company page, Impressum/Legal, or entity-specific subpage.
- Group count & name: Accept only if the page clearly indicates group-level scope (keywords/translations: Group, Holding, Konzern, Gruppe, Corporate, Group-wide, 集团/集團, グループ, Grupo). Extract the official group/holding name from header/footer, legal/imprint, "Our Group/Konzern/Gruppe" pages, or clearly labeled group overview pages.
- Populate both scopes when available. If only group exists after exhaustive search for entity, populate group fields and leave company fields blank.
- Do not misattribute group totals to the entity.
- Recency / Non-historic (MANDATORY):
- Exclude historical/timeline content: URLs/headings like history, timeline, milestones, our-story, heritage, anniversaries, or retrospective phrasing ("In 2019 we were…").
- Capture visible date signals ("Updated", "as of"; DE: "Stand", "zuletzt aktualisiert"; FR/ES/IT/NL/PT equivalents).
- Discard statements explicitly older than 24 months from today.
- Press/News acceptable only if ≤ 24 months old and scope is clear.
- If a core page (Home/About/Company) lacks a visible date and is not historical/press, treat as current unless contradicted elsewhere by a newer dated statement.
- Authority preference when multiple current statements conflict:
- Prefer Home/About/Company hero counters over Careers/Blog/Press.
- Prefer explicit entity statements over group for the company scope; still record group if available.
- Record the chosen page(s) as Source URL fields.
- Allowed method values (choose the most specific per scope and append _recency_validated when applicable):
- Company scope: entity_scope_exact, entity_scope_lower_bound, entity_scope_range_upper_bound, entity_scope_approximate
- Group scope: group_scope_exact, group_scope_lower_bound, group_scope_range_upper_bound, group_scope_approximate
- When selected due to page authority conflict, append _conflict_resolved_prefer_about.
- Output rules:
- Output exactly seven lines in the specified schema, no extra lines, bullets, or commentary.
- After the colon, add a single space and then the value (or leave blank).
# STEPS
1. Open https://{{company domain}}. Identify the legal entity via header/footer and legal pages (Impressum/Legal). Note entity vs potential group references.
2. Company scope search on high-signal pages: "/", "/about", "/company", "/team", "/careers", "/jobs", "/join-us", "/culture". Include homepage hero text, counters, large headings, and alt/aria labels.
3. If not found, perform a site-limited search (site:{{company domain}}) combining entity terms with employee synonyms and localized keywords (see patterns above).
4. Parse candidate pages and extract visible date signals; exclude historical/timeline content and items older than 24 months.
5. Run the symbolic & localized patterns. Normalize numbers. Apply the exclusion proximity test to avoid customers/vehicles/etc. If valid, set the three Company lines.
6. Group scope search: navigate to group/holding pages linked from the site (e.g., "Gruppe/Konzern/Our Group/Holding/Corporate"), validate group scope. Extract group employee count and group name; normalize the number; set the three Group lines and Group Name.
7. Resolve conflicts by recency and authority. It is acceptable for company and group numbers to differ; ensure each is correctly scoped and sourced.
8. Produce the final seven-line output exactly in the required schema.
# EXAMPLES
Company Employees: 400
Company Source URL: https://rein-spedition.de/
Company Method: entity_scope_lower_bound_recency_validated
Group Employees:
Group Source URL:
Group Method:
Group Name:
Company Employees: 128
Company Source URL: https://subsidiary-gmbh.com/about
Company Method: entity_scope_exact_recency_validated
Group Employees: 4200
Group Source URL: https://holding.example.com/konzern/ueberblick
Group Method: group_scope_exact_recency_validated
Group Name: ACME Holding GmbH
Company Employees:
Company Source URL:
Company Method:
Group Employees: 200
Group Source URL: https://brand.example.com/group
Group Method: group_scope_lower_bound_recency_validated
Group Name: Example Group S.A.
The "Failed to parse formula for 'prompt'" error usually means there’s a formatting or syntax issue in your prompt, even if it works elsewhere. To fix it:
Check for missing or extra quotation marks, commas, or brackets.
Ensure all keys and dynamic column tags are properly quoted.
Remove any trailing commas.
Look for hidden/special characters by pasting your prompt into a plain text editor.
Use a JSON validator like JSONLint to check for errors.
Is that what you were looking for?
No. Its still not working
I'm sorry to hear that it's still not working. I'll connect you to a human agent who can assist you further.
Clay Support is sharing a file with you.
Our support team has got your message and we'll get back to you soon!
If you’re dealing with a specific table, drop the URL below so we can help you quicker. Otherwise, someone from our team will be in touch soon!
https://app.clay.com/workspaces/607363/workbooks/wb_0t4w58oBer57bpheUft/tables/t_0t4w59rX5rjHHPVkJM4/views/gv_0t4w59tz5oukKiFabKX Employee Count & Group and Get Number of Employees are throwing the error.
It seems to be a bug on your end.
🔗 Merged conversation This thread has been merged into your main conversation. To keep the discussion going and see all replies, please continue in the main conversation.
