Nested Actions Development
Description:
Nested actions, allow you to include and call actions from other groups in a particular group. To reduce costs, this method has been chosen rather than calling other actions through the action manager.
- Nested Aciton Spike - Link
Important notes:
1) The output size of the lambda function will grow as the groups included in it increase 2) The root group requires nested group environment variables 3) Depending on the type of runtime execution, some groups cannot be called from other (Docker runtime groups can't be called from Linux NodeJs (ZIP) runtime)
To add new nested group to target group:
SH_ACTION: 1) In your AppModule register Nested Action Grouo passing them as array:
@Module({
imports: [
ExecutorModule.register(PlaywrightActionMapping, [MicrosoftActionMapping]),
SqsQueueModule,
LoggerModule,
],
})
2) Add required env to serverless.yml file
3) Extend super constructor of you target action to provide nestedAction array:
constructor(
description: ActionDescription<ActionType>,
options: WorkflowOptions,
actionType: BROWSER_AUTO_PLAYWRIGHT,
executeAction: ActionExecutionFunction
) {
const settings = (description as ActionDescription<BROWSER_AUTO_PLAYWRIGHT>)
.settings;
super(
actionType,
{
...(description as any),
executeAction, // <----- Provide this function
nestedActions: settings.nestedActions, // <--- Your list of nestedActions
},
options
);
4) Use this.nestedActionExecutor.execute function to invoke nested action e.g.:
this.nestedActionExecutor.execute({
serialNumber: 0 // <--- indxed of action,
input //<-- input for nested action
})
SH_PROJECT: 1) Extend NestedActions object with your desired action:
export const NestedActions = [
ActionType.SHORT_BROWSER_AUTO_PLAYWRIGHT,
ActionType.LONG_BROWSER_AUTO_PLAYWRIGHT,
];
Console 1) Extend NestedActions object with your desired action:
export const allowedNestedActionTypes = [
'long_browser_auto_playwright',
'short_browser_auto_playwright',
]
2) Modify your target action settings to include nestedSettings and settings.nestedActions similar to playwright.