When to use it
Use the Ingest destination when the output of a schema is itself useful input:- Chain schemas. Split a transformation into steps, where each step triggers on the source entities the previous step wrote.
- Materialise a combined view. Store a view that joins several source entities as a single source entity, so later schemas read one entity instead of repeating the lookups.
- Build a hierarchy. Give each ingested source entity a parent, so you can query everything under it.
- Record workflow state. Write small records (a plan, a ticket, a result) that drive the next step of a multi-step process.
How it works
- A schema with the destination generates or updates a view.
- The destination fetches the view from the Delivery API, using the environment client you configured.
- It ingests the view as is into the source you selected in the connection. View references are already resolved by the Delivery API.
- When the view is deleted, the destination deletes the matching source entity again.
Configuration
The destination is configured per Enterspeed environment. In order to set up the Ingest configuration you need the following:
You select the environment client and the source from the ones in your tenant. You never paste or see an API key. Enterspeed looks up the keys when you save the connection.
You can only select a source that is in the same tenant.
A change to the connection applies to views queued after you save it. Views that are already queued still use the previous environment client and source.
A connection saved before this change has no environment client or source selected. Open it and save it again. Until you do, every view it receives fails with
Connection.Configuration.EnvironmentClientMissing or Connection.Configuration.SourceMissing.Options
Options are set on the destination in the schema’sactions method. All options are optional, and each one can differ per source entity.
Example of usage
This schema triggers on products and ingests a small summary record for each one. Other schemas can then trigger on theproductSummary type.
Product schema with Ingest destination
Schema that triggers on the ingested type
'pipeline' is the source group of the source the destination ingests into.
The first schema prefixes originParentId the same way as originId. This makes the summaries form the same hierarchy as the products they came from. originParentId must point at an origin id in the target source, not the source the view came from. Otherwise the parent doesn’t resolve.
Designing a self-ingesting flow
Ingesting into Enterspeed from Enterspeed makes it easy to build flows that feed themselves. Follow these rules to keep them predictable.Avoid loops
A schema must never trigger on a type it writes. If it does, every ingest triggers the schema again, and the flow never stops. The destination only detects the simplest case, described in self-overwrite guard. Other loops are not detected. Keep triggers apart by type. Give every ingested record asourceEntityType of its own, and let each schema trigger on exactly the type it consumes.
Self-overwrite guard
A view comes from a source entity in a source. The destination knows both, and it knows the source you ingest into. If the source is the same and the resolvedoriginId is the same, the destination would replace the source entity with its own view. That reprocesses the schema that produced the view.
In that case the destination refuses the view with Ingest.Loop.SelfOverwrite and doesn’t retry it. The error message tells you to set a distinct originId or ingest into another source. The Ingest API also rejects a changed type, but only when the types differ. The guard covers what that check doesn’t: same-type overwrites and deletions. It applies to changes and deletions:
- Change. The source entity isn’t replaced with its own view.
- Deletion. The destination doesn’t delete the original data. It only deletes copies it made itself.
originId, because originId defaults to the origin id of the source entity the view came from.
To ingest into the same source, set a different originId. This is allowed on purpose, for example to write records back into the source they came from:
Ingest into the same source under another origin id
Always set sourceEntityType
A source entity’s type can’t be changed after it’s first ingested. If you forget sourceEntityType, the view is ingested as document. To fix it, you have to delete the source entity and ingest it again.
Give each schema its own originId
originId defaults to the origin id of the source entity the view was generated from. If two schemas send views of the same source entity to the same Ingest destination, both write to the same source entity and overwrite each other.
Set a distinct originId per schema, for example with a prefix such as summary- or plan|.
Keep the view deterministic
Publishing a schema reprocesses its source entities and sends their views to every destination again. Enterspeed reports a source entity whose content hasn’t changed as unchanged, so nothing downstream is triggered. Avoid values that change on every run, such as the current time. A view withnew Date() in it is different every time, so each publish rewrites the source entity and retriggers every schema that reads it.