📫
Automail
  • Introduction
  • Installation
    • Local DEV
    • Containerized PROD
    • Windows PROD
  • Repository
  • Architecture
  • Configurations
    • Settings
    • UI Configuration
      • Site
        • Selectpickers
          • Filter
          • Tokenfield
        • Panels
          • ChartJS
          • Amcharts
          • Table
          • Regular Table
          • Metrics
          • Gallery
          • LeafletMap
          • Itemlist
          • Card
          • Downloads
      • Admin
    • Workflow Configuration
      • Sync Workflows
        • Autoform Nav Elements
      • Custom Workflows
      • Dags
Powered by GitBook
On this page
  1. Configurations
  2. Workflow Configuration

Custom Workflows

Any custom logic

PreviousAutoform Nav ElementsNextDags

Last updated 8 months ago

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

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()
Sync Workflows