Skip to main content

Custom script directory

By default, fal assumes that the directory where scripts are stored is the root directory of a dbt project. You can change this. Within your dbt_project.yml, you can add a custom variable that will tell fal where to look for scripts:

fal-scripts-path: "my_scripts_dir"

Now, if a script ( is put in my_scripts_dir directory within your dbt project, you can refer to it by name in schema.yml:

- name: some_model

Similarly, you can do it when using the --scripts flag:

fal run --scripts

Local imports in your fal scripts

The directory containing fal scripts is temporarily added to sys.path during runtime. This means that you can import local modules in your scripts directory. Say we have the following structure in our scripts directory:

└── my_scripts_dir
└── my_utils
└── message

This will allow you to do local imports in

from my_utils.message.slack import send_slack_message

Also, within you can do relative imports:

from ..custom_functions import format_string
formatted = format_string(my_string)

Note that in this example, my_scripts_dir is not itself loaded as a module, so a from .. import wouldn't work in Instead, you can do import random_script, because everything in my_scripts_dir is available in sys.path.