# Getting SourcesNotImportedToRepository error when using @external\_systems decorator

**URL:** <https://community.palantir.com/t/getting-sourcesnotimportedtorepository-error-when-using-external-systems-decorator/6756>\
**Category:** Ask the Community\
**Tags:** code-repositories, pipeline-builder\
**Created:** [June 12, 2026, 9:24am UTC](https://community.palantir.com/t/getting-sourcesnotimportedtorepository-error-when-using-external-systems-decorator/6756 "2026-06-12T09:24:34Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Janardhan](https://yyz1.discourse-cdn.com/palantir/user_avatar/community.palantir.com/janardhan/32/7745_2.png) [@Janardhan](https://community.palantir.com/u/Janardhan)\
**Post date:** [June 12, 2026, 9:24am UTC](https://community.palantir.com/t/getting-sourcesnotimportedtorepository-error-when-using-external-systems-decorator/6756/1 "2026-06-12T09:24:34Z")

</div>

Getting SourcesNotImportedToRepository error when using @external\_systems decorator. Sources are in transforms-shrinkwrap.yml but build still fails.

How do I properly import Data Connection sources into a Python transforms repository?

---

<div class="post-metadata">

**Author:** ![montes](https://yyz1.discourse-cdn.com/palantir/user_avatar/community.palantir.com/montes/32/7701_2.png) [@montes](https://community.palantir.com/u/montes)\
**Post date:** [June 12, 2026, 3:03pm UTC](https://community.palantir.com/t/getting-sourcesnotimportedtorepository-error-when-using-external-systems-decorator/6756/2 "2026-06-12T15:03:03Z")

</div>

**Hey, Janardhan!**

This error means the source exists in Data Connection but hasn’t been fully authorized for use in your repository. Having it in `transforms-shrinkwrap.yml` is not enough, there are three independent toggles that all need to be on:

**1. Enable code import on the source itself**  
In Data Connection, open your source → go to **Connection settings \> Code import configuration** → toggle on **Allow this source to be imported into code repositories**.

This is the most commonly missed step. The source must explicitly opt in to being used in code.

**2. Enable external systems on the repository**  
In your Code Repository → **Settings tab \> Repository \> External systems** → toggle on **Allow access to external systems from this repository**.

Note: this toggle requires the **Information Security Officer** role in Foundry. If you don’t have it, you’ll need to ask someone who does (it’s managed in Control Panel).

**3. Import the source into the repository**  
With both toggles on, go to your repository and explicitly import the source. The `@external_systems` decorator references the source object, not just its name — the import step is what makes that reference resolvable at build time.

* * *

**A note on the legacy decorator:**  
If you previously used `@use_external_systems`, be aware that you cannot mix both decorators in the same repository. The new `@external_systems` decorator with source references is the current supported approach, and the two are mutually exclusive per transform.

* * *

> **Felipe Montes**  
> Development Advisor  
> Follow me @ linkedin.com/in/felipemontesl/ or GitHub: Brazillianerd

---

<div class="post-metadata">

**Author:** ![Janardhan](https://yyz1.discourse-cdn.com/palantir/user_avatar/community.palantir.com/janardhan/32/7745_2.png) [@Janardhan](https://community.palantir.com/u/Janardhan)\
**Post date:** [June 15, 2026, 7:13am UTC](https://community.palantir.com/t/getting-sourcesnotimportedtorepository-error-when-using-external-systems-decorator/6756/3 "2026-06-15T07:13:11Z")

</div>

Thank you @montes. I was able to resolve my issue.

---

<div class="post-metadata">

**Author:** ![montes](https://yyz1.discourse-cdn.com/palantir/user_avatar/community.palantir.com/montes/32/7701_2.png) [@montes](https://community.palantir.com/u/montes)\
**Post date:** [June 15, 2026, 7:20pm UTC](https://community.palantir.com/t/getting-sourcesnotimportedtorepository-error-when-using-external-systems-decorator/6756/4 "2026-06-15T19:20:35Z")

</div>

Thanks for letting me know. If possible, please mark my response as the solution to help others in the community who may encounter the same issue

Have a great day!

---

<div class="post-metadata">

**Author:** ![system](https://yyz1.discourse-cdn.com/palantir/user_avatar/community.palantir.com/system/32/3_2.png) [@system](https://community.palantir.com/u/system)\
**Post date:** [September 15, 2026, 3:21am UTC](https://community.palantir.com/t/getting-sourcesnotimportedtorepository-error-when-using-external-systems-decorator/6756/5 "2026-09-15T03:21:13Z")

</div>

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.
