# Automatization after after project creation

**URL:** <https://community.shotgridsoftware.com/t/automatization-after-after-project-creation/8693>\
**Category:** Pipeline Integrations\
**Created:** [May 15, 2020, 1:36pm UTC](https://community.shotgridsoftware.com/t/automatization-after-after-project-creation/8693 "2020-05-15T13:36:38Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![benwall](https://sea1.discourse-cdn.com/shotgunsoftware/user_avatar/community.shotgridsoftware.com/benwall/32/1386_2.png) [@benwall](https://community.shotgridsoftware.com/u/benwall)\
**Post date:** [May 15, 2020, 1:36pm UTC](https://community.shotgridsoftware.com/t/automatization-after-after-project-creation/8693/1 "2020-05-15T13:36:38Z")

</div>

Hey there,  
I’d like to automatize some API stuff and folder creation after an Advanced Project Setup has been done on a project.

Is there a hook which would do that?

Thanks

---

<div class="post-metadata">

**Author:** ![tannaz](https://sea1.discourse-cdn.com/shotgunsoftware/user_avatar/community.shotgridsoftware.com/tannaz/32/32_2.png) [@tannaz](https://community.shotgridsoftware.com/u/tannaz)\
**Post date:** [May 15, 2020, 7:40pm UTC](https://community.shotgridsoftware.com/t/automatization-after-after-project-creation/8693/2 "2020-05-15T19:40:52Z")

</div>

Hey Ben – We don’t have any hooks in the advanced config setup process. If you’re running the Advanced Setup wizard in Desktop to create your configs, I don’t have any suggestions, but you could potentially write a commandline tool to setup the project then do any post-processing that you specify.

We have a tank command, `tank setup_project`, that is used for this process. You could write a python script that runs the `setup_project` command, followed by your desired logic.

Here are some useful links:

- [This forum post](https://community.shotgridsoftware.com/t/how-can-i-unregister-folders-when-using-a-distributed-config/189) includes an example of running a `tank` command via API. In this case the command in question is `unregister_folders`, but the general idea should work for `setup_project`
- The [actual `setup_project.py` module](https://github.com/shotgunsoftware/tk-core/blob/master/python/tank/commands/setup_project.py)
- [An example of running `setup_project` via API from one of our unit tests](https://github.com/shotgunsoftware/tk-core/blob/4ad221af10855df9179da362cac5463f05d3de39/tests/commands_tests/test_setupproject.py#L87-L106)

Hope that helps! Let us know if you have any other questions.

---

<div class="post-metadata">

**Author:** ![benwall](https://sea1.discourse-cdn.com/shotgunsoftware/user_avatar/community.shotgridsoftware.com/benwall/32/1386_2.png) [@benwall](https://community.shotgridsoftware.com/u/benwall)\
**Post date:** [May 18, 2020, 8:09am UTC](https://community.shotgridsoftware.com/t/automatization-after-after-project-creation/8693/3 "2020-05-18T08:09:51Z")

</div>

Thanks for you answer!

---

<div class="post-metadata">

**Author:** ![Patrick](https://sea1.discourse-cdn.com/shotgunsoftware/user_avatar/community.shotgridsoftware.com/patrick/32/4767_2.png) [@Patrick](https://community.shotgridsoftware.com/u/Patrick)\
**Post date:** [February 17, 2021, 10:56pm UTC](https://community.shotgridsoftware.com/t/automatization-after-after-project-creation/8693/4 "2021-02-17T22:56:07Z")

</div>

Handy stuff!  
Do you know if it’s possible to define the pipeline config uri to specify the branch to use? or will it only pull from master?  
Alternatively, I thought I could use a shotgun descriptor to pull from the current site config, but it looks like the setup\_project.py module only accepts either paths on disk, or a git repo url.

---

<div class="post-metadata">

**Author:** ![mmoshev](https://sea1.discourse-cdn.com/shotgunsoftware/user_avatar/community.shotgridsoftware.com/mmoshev/32/476_2.png) [@mmoshev](https://community.shotgridsoftware.com/u/mmoshev)\
**Post date:** [February 18, 2021, 7:35am UTC](https://community.shotgridsoftware.com/t/automatization-after-after-project-creation/8693/5 "2021-02-18T07:35:56Z")

</div>

Hm wait, there is [tk-config-default/after\_project\_create.py at master · shotgunsoftware/tk-config-default · GitHub](https://github.com/shotgunsoftware/tk-config-default/blob/master/after_project_create.py)  
which looks like what you need. We have been using this for a while.  
This file sits in your config root directory, not in hooks.
