Skip to content

Commit af4a677

Browse files
improvement(enrichments): limit company-info to fields both providers return
Hunter's company dataset returns null industry/foundedYear for many large companies (verified against the live API for Microsoft, Amazon, Google, etc.), so under the first-non-empty-wins cascade those columns showed up inconsistently. Limit company-info outputs to employee count and description — the fields Hunter and PDL both reliably return — so every row is consistent.
1 parent c0642ce commit af4a677

1 file changed

Lines changed: 7 additions & 18 deletions

File tree

apps/sim/enrichments/company-info/company-info.ts

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,22 @@ import { Building2 } from 'lucide-react'
33
import { normalizeDomain, str, toolProvider } from '@/enrichments/providers'
44
import type { EnrichmentConfig } from '@/enrichments/types'
55

6-
/** Returns the value when it's a finite number, else `undefined`. */
7-
function num(value: unknown): number | undefined {
8-
return typeof value === 'number' && Number.isFinite(value) ? value : undefined
9-
}
10-
116
/**
12-
* Company Info enrichment. Looks up firmographics for a company domain, trying
13-
* Hunter first (free) then People Data Labs as a fallback. `employeeCount` is a
14-
* string so both Hunter's range bucket (e.g. `"11-50"`) and PDL's exact count
15-
* map onto the same column — the result stays consistent regardless of which
16-
* provider fills the cell.
7+
* Company Info enrichment. Looks up a company by domain, trying Hunter first
8+
* (free) then People Data Labs as a fallback. Outputs are limited to the fields
9+
* both providers reliably return — employee count and description — so the
10+
* result stays consistent regardless of which provider fills the cell.
11+
* `employeeCount` is a string so Hunter's range bucket (e.g. `"11-50"`) and
12+
* PDL's exact count map onto the same column.
1713
*/
1814
export const companyInfoEnrichment: EnrichmentConfig = {
1915
id: 'company-info',
2016
name: 'Company Info',
21-
description:
22-
"Look up a company's industry, size, founding year, and description from its domain.",
17+
description: "Look up a company's size and description from its domain.",
2318
icon: Building2,
2419
inputs: [{ id: 'domain', name: 'Company domain', type: 'string', required: true }],
2520
outputs: [
26-
{ id: 'industry', name: 'industry', type: 'string' },
2721
{ id: 'employeeCount', name: 'employee count', type: 'string' },
28-
{ id: 'foundedYear', name: 'founded year', type: 'number' },
2922
{ id: 'description', name: 'description', type: 'string' },
3023
],
3124
providers: [
@@ -40,9 +33,7 @@ export const companyInfoEnrichment: EnrichmentConfig = {
4033
},
4134
mapOutput: (output) => {
4235
return filterUndefined({
43-
industry: str(output.industry) || undefined,
4436
employeeCount: str(output.size) || undefined,
45-
foundedYear: num(output.founded_year),
4637
description: str(output.description) || undefined,
4738
})
4839
},
@@ -59,9 +50,7 @@ export const companyInfoEnrichment: EnrichmentConfig = {
5950
mapOutput: (output) => {
6051
const company = output.company as Record<string, unknown> | undefined
6152
return filterUndefined({
62-
industry: str(company?.industry) || undefined,
6353
employeeCount: str(company?.employee_count) || undefined,
64-
foundedYear: num(company?.founded),
6554
description: str(company?.summary) || undefined,
6655
})
6756
},

0 commit comments

Comments
 (0)