<p dir="auto">The current airflow scheduler architecture can scan the DAG, understand the cron schedule defined in the DAG and submit a task to a local/remote executor. This works best for most of use cases to automate any flavor of workflows. The cron schedule can fit most of workflow patterns but there are few complex business scheduling requirements as specified below.</p>
<ol dir="auto">
<li>Run the workflow on every alternative week ends and don't run on holidays</li>
<li>Run the workflow on every week and include few holidays except Christmas and New Year.</li>
</ol>
<p dir="auto">These 2 are sample examples.</p>
<p dir="auto"><strong>Use case / motivation</strong></p>
<p dir="auto">Most of licensed scheduler have calendar based scheduling feature where users can pick or customize schedule according to pre-defined calendar for each workflow.</p>
<p dir="auto">**Feature Request ** :</p>
<ol dir="auto">
<li>Have a configurable option to use customized calendar based schedule or cron based<br>
schedule for each DAG.</li>
<li>Scheduler can read the option at each DAG level schedule option and act according to calendar based schedule or cron based schedule</li>
<li>Webserver  DAG Graph view can display the calendar based schedule or cron based schedule.</li>
</ol>
<p dir="auto"><strong>Note:</strong>  This feature request is based on usage of airflow for more than 3 to 4 years and felt it would be a great feature to incorporate in the airflow architecture.</p>
<h3 dir="auto">Apache Airflow version</h3>
<p dir="auto">2.1.3</p>
<h3 dir="auto">Operating System</h3>
<p dir="auto">Linux</p>
<h3 dir="auto">Versions of Apache Airflow Providers</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Deployment</h3>
<p dir="auto">Other</p>
<h3 dir="auto">Deployment details</h3>
<p dir="auto">Community Helm chart 8.0.8</p>
<h3 dir="auto">What happened</h3>
<p dir="auto">I have created 1000 dags like that</p>
<p dir="auto"><strong>test_AIR10001.py</strong><br>
...<br>
<strong>test_AIR11001.py</strong></p>
<p dir="auto">After wait period of 5 minutes try to open any dag and can't.<br>
Here is an exception details: <a href="https://sentry.io/share/issue/b97fca62ccec47709e814e70deb3e4ba/" rel="nofollow">https://sentry.io/share/issue/b97fca62ccec47709e814e70deb3e4ba/</a></p>
<p dir="auto">If I try do do 5 dags like that I do not have this issue.</p>
<h3 dir="auto">What you expected to happen</h3>
<p dir="auto">I expect dags would be loaded to Ariflow without any issue</p>
<h3 dir="auto">How to reproduce</h3>
<p dir="auto"><strong>dag code</strong></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import numpy as np
from airflow import DAG
from airflow.operators.python import PythonOperator
from datetime import datetime
from src.helpers import dag_helper

with DAG(
    dag_id=dag_helper.get_dag_id_from_path(__file__),
    schedule_interval=None,
    start_date=datetime(2021, 1, 1),
    catchup=False,
    tags=[&quot;example&quot;]
) as dag:
    def print_array():
        &quot;&quot;&quot;Print Numpy array.&quot;&quot;&quot;
        a = np.arange(15).reshape(3, 5)
        print(a)
        time_wait_cuy = dag_helper.get_time_wait_cuy()
        print(time_wait_cuy)
        return time_wait_cuy


    run_this = PythonOperator(
        task_id=&quot;print_the_context&quot;,
        python_callable=print_array,
    )"><pre class="notranslate"><code class="notranslate">import numpy as np
from airflow import DAG
from airflow.operators.python import PythonOperator
from datetime import datetime
from src.helpers import dag_helper

with DAG(
    dag_id=dag_helper.get_dag_id_from_path(__file__),
    schedule_interval=None,
    start_date=datetime(2021, 1, 1),
    catchup=False,
    tags=["example"]
) as dag:
    def print_array():
        """Print Numpy array."""
        a = np.arange(15).reshape(3, 5)
        print(a)
        time_wait_cuy = dag_helper.get_time_wait_cuy()
        print(time_wait_cuy)
        return time_wait_cuy


    run_this = PythonOperator(
        task_id="print_the_context",
        python_callable=print_array,
    )
</code></pre></div>
<p dir="auto"><strong>Here is dag_helper</strong></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import os
from pathlib import Path


def get_time_wait_cuy():
    return os.environ['environment']


def get_dag_id_from_path(dag_file_path):
    path = Path(dag_file_path)
    stem = path.stem
    trimmed_path = Path(*path.parts[5:len(path.parts) - 1])
    prefix = str(trimmed_path).replace(os.path.sep, '_')
    return '__'.join([prefix, stem])
"><pre class="notranslate"><code class="notranslate">import os
from pathlib import Path


def get_time_wait_cuy():
    return os.environ['environment']


def get_dag_id_from_path(dag_file_path):
    path = Path(dag_file_path)
    stem = path.stem
    trimmed_path = Path(*path.parts[5:len(path.parts) - 1])
    prefix = str(trimmed_path).replace(os.path.sep, '_')
    return '__'.join([prefix, stem])

</code></pre></div>
<h3 dir="auto">Anything else</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Are you willing to submit PR?</h3>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Yes I am willing to submit a PR!</li>
</ul>
<h3 dir="auto">Code of Conduct</h3>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I agree to follow this project's <a href="https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md">Code of Conduct</a></li>
</ul>