Add Salesforce enrichment workflow (90-day cadence) - #1
Draft
nico-dot wants to merge 1 commit into
Draft
Conversation
Co-authored-by: Nico <nico-dot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Builds a self-contained workflow that keeps Salesforce (SFDC) records enriched with firmographic data on a rolling 90-day cadence. The repo previously contained only a README, so this adds the full project from scratch.
Each record is re-enriched at most once per 90 days: the job finds records that were never enriched or whose
Last_Enriched__cis older than 90 days, looks them up by company domain via an enrichment provider, writes the attributes back, and stampsLast_Enriched__c.How the 90-day cadence is enforced
GitHub
croncan't express a true "every 90 days" period, so it's done in two layers:0 6 1 */3 *, ~every 90 days).Last_Enriched__cis null or older thanENRICH_INTERVAL_DAYS(default 90). So no record is re-enriched more often than every 90 days, even if the job runs more frequently. This is the robust interpretation and is safe on any schedule.What's included
src/sfdc_enrichment/— env-driven config, asimple-salesforceclient (SOQL query + Bulk API updates), a pluggable enrichment provider interface (mockoffline provider + generichttpprovider), the orchestration/freshness logic, and a CLI (python -m sfdc_enrichment, with--dry-runand--show-query)..github/workflows/enrich-sfdc.yml— scheduled +workflow_dispatch(withdry_run/max_recordsinputs), wired to secrets/vars.tests/— 28 pytest tests, all offline (no live org or API key needed).README.md,.env.example,requirements*.txt.Setup notes for the user
Last_Enriched__con the target object (defaultAccount), or point at your own viaSFDC_LAST_ENRICHED_FIELD.mockprovider so it runs safely out of the box.Testing
python -m pytest→ 28 passed.python -m sfdc_enrichment --show-queryrenders the expected SOQL with a 90-day cutoff.Design decisions
mockprovider (deterministic, offline) so CI and dry runs need no credentials; swap in a real vendor by implementingEnrichmentProvider.