Custom Workflows

Any custom logic

Custom workflows are used for background tasks that are not covered by Sync Workflows.

To stay consistent with the overall project structure, each custom workflow must be within a py file located in the project folder.

The py file will start with the generic import of components relevant to Automail (e.g. custom_models to access all models, custom_functions to access all project functions, etc.). Each workflow would then be defined within its own function and called in the main as in the example below.

try:
    from _init import * # DEV env
except ImportError:
    from configurations.workflow_env import * # PROD env

def count_delivery_records():
    print("Delivery records:", custom_models.Delivery.objects.all().count())

if __name__ == '__main__':
    count_delivery_records()

Last updated