def my_fun(context): if context.get('dag_run').external_trigger: print('manual run') else: print('scheduled run')