Skip to content

Commit fa1c1c2

Browse files
authored
Merge pull request #7603 from opsmill/wvd-20251021-generators
Update generators documentation
2 parents 9b3f20f + a9699bc commit fa1c1c2

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

docs/docs/topics/generator.mdx

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,29 @@ Generators are defined as a **generator definition** within an [.infrahub.yml](i
2222

2323
![](../media/topics/generator/generator_overview.excalidraw.svg)
2424

25-
Running an artifact definition will create new nodes as defined by the generator, or remove old ones that are no longer required. The removal of obsolete objects is handled using the [SDK tracking feature]($(base_url)python-sdk/topics/tracking)
25+
Running a generator definition will create new nodes as defined by the generator, or remove old ones that are no longer required. The removal of obsolete objects is handled using the [SDK tracking feature]($(base_url)python-sdk/topics/tracking)
2626

2727
The targets point to a [group](./groups.mdx) that will consist of objects that are impacted by the generator. The members of this group can be any type of object within your schema, service objects, devices, contracts or anything you want the generator to act upon. Generator groups (`CoreGeneratorGroup`) serve as target collections that define which objects trigger generator execution, while the actual tracking of generated objects is handled by individual generator instances.
2828

2929
The [GraphQL query](graphql) defines the data that will be collected when running the generator. Any object identified in this step is added as a member to a GraphQL query [group](./groups.mdx) (`CoreGraphQLQueryGroup`). The membership in these groups are then used to determine which generators need to be executed as part of a proposed change during the pipeline run.
3030

3131
The Generator itself is a Python class that is based on the `InfrahubGenerator` class from the SDK. Just like [transforms](transformation) and [checks](check), the Generators are user defined.
3232

33+
Generators can be executed in several ways, depending on your workflow and where you are in the lifecycle (local development vs. in Infrahub):
34+
35+
1. During development with infrahubctl
36+
37+
Use the `infrahubctl generator` command to iterate locally while building and testing your generator.
38+
2. Manually from the UI
39+
40+
From the Infrahub UI, open the Generator Definition detail page (Actions > Generator Definitions) and click Run to trigger the generator on demand.
41+
3. Automatically via Proposed Changes
42+
43+
When you open a Proposed Change that affects the generator’s targets, the generator runs as part of Infrahub’s CI checks. Review the results in the Checks and Data tabs of the Proposed Change. This behavior can also be disabled per generator in the repository configuration file.
44+
4. Automatically via Events and Actions
45+
46+
You can configure Infrahub Event rules and Actions to trigger generators automatically based on changes in your data. This enables fully automated execution aligned with your workflows.
47+
3348
## Video guides
3449

3550
In this video series we’re diving into the concept of generators and services, exploring their significance, structure, and how they can streamline processes for teams. Whether you’re a developer or just curious about automation in IT, this guide will provide you with a comprehensive understanding of generators and their applications.

0 commit comments

Comments
 (0)