2026-02-25 - Code Hooks and Flow Steps
Jump to navigation
Jump to search
Concepts
- plugInHooks split the generated flow code into multiple Lambdas
- PlugInHooks are case specific, some invocations will invoke sync or async code, some will not
- codeHooks are hard-wired, all invocations run the codeHook logic
- codeHooks will vary per service and per case (eg objType in shared endpoint)
- Two locations for codeHooks, one is in flow generated Lambdas (name: codeHooks), second is codeHooks in per service standard generated code, eg createObject (name: generatedCodeHooks)
- codeHooks are case specific, not shared across multiple services, not important in this topic
- generatedCodeHooks adjust the generated code, eg breaking code in some services/cases to be async
- some generatedCodeHooks will initiate a flow, eg validate create Issue
- some generatedCodeHooks will be in the middle of a flow, eg update CategoryNode in regenerateCategoryTree flow
How to build per service generated code
initiating a flow
When generating per service code, pull all flowSchemas for that service and check if any have event=generatedCode, then use generatedCodeConfig to split generated code into multiple lambdas in cases where async generatedCodeHooks are used.
Use codeHookTag to specify which codeHook in per service generated code to initiate the flow from.
code in middle of flow
Also check all flowSteps in each flow for the service to check for generatedCodeConfig, if exists use same method to add code into per service generated code.
old notes
- Generated code such as createObject old code has hooks (developer code) according to objType, sometimes this is sync and sometimes async
- Can use similar structure of splitting that code into Lambdas according to codeHooks/plugInHooks
This will add another level to generated code
- generate code template with top level generated plugInHooks/codeHooks
- flowSteps then take over the top level codeHooks with generated code that has flow level codeHooks and plugInHooks
- both of these steps will create multiple Lambdas according to the hooks they offer
- do we have flowSchemas for generated flows like createObject yet?
Idea
- flowSteps can only add hooks to objType generated code in it's own service
- when generating objType generated code check all flow schemas in service to see if any add logic in the generated flow
- adjust the objType generated code accordingly, this may mean additional Lambdas according to the flowStep config