Motivation
Firm doesn't exist in isolation. While some aspects may be managed with firm over other solutions, a modern business will still have external tools that they use - accounting tools, CRM, wordpress, etc.
We need a way to bring external information into the firm graph so it can be queried in a holistic context.
Proposal
Not exactly sure what would be the most ergonomic way of doing this.
Idea: External block
Mimics in some aspects the Terraform data block, except it would run arbitrary scripts to get the data.
external social_integration {
script = path"./get_social_data.py"
arguments = "--id some_id"
}
An external block could define a script (Python? JS?) which outputs an entity. When the graph is built, the script is evaluated to produce the entity. Other entities might then be able to reference that external:
person from_social {
name = external.social_integration.name
}
Idea: Expand block
A block which expands into a DSL entity.
expand social_integration {
script = path"./get_social_data.py"
arguments = "--id some_id"
}
An external block could also define a script which outputs an entity. The difference being that this gets resolved when the DSL is parsed, generating a new DSL entity block next to the expand block. We would need some way of tracking where the DSL came from, so it's not expanded twice and could potentially be updated if we have changes.
person from_social {
name = "Expanded name"
expanded_from = expand.social_integration
}
Backward compatibility
I reckon this can be introduced as a new language type, keeping entities / schemas intact.
Considerations
What happens when an external integration fails to run or produce the expected entity? How to test? Fail early or best effort?
Motivation
Firm doesn't exist in isolation. While some aspects may be managed with firm over other solutions, a modern business will still have external tools that they use - accounting tools, CRM, wordpress, etc.
We need a way to bring external information into the firm graph so it can be queried in a holistic context.
Proposal
Not exactly sure what would be the most ergonomic way of doing this.
Idea:
ExternalblockMimics in some aspects the Terraform data block, except it would run arbitrary scripts to get the data.
An external block could define a script (Python? JS?) which outputs an entity. When the graph is built, the script is evaluated to produce the entity. Other entities might then be able to reference that external:
Idea:
ExpandblockA block which expands into a DSL entity.
An external block could also define a script which outputs an entity. The difference being that this gets resolved when the DSL is parsed, generating a new DSL entity block next to the expand block. We would need some way of tracking where the DSL came from, so it's not expanded twice and could potentially be updated if we have changes.
Backward compatibility
I reckon this can be introduced as a new language type, keeping entities / schemas intact.
Considerations
What happens when an external integration fails to run or produce the expected entity? How to test? Fail early or best effort?