How can I create a relation with the same entity?
I wanna create the parent relation (it's a property) inside property, how can I do that?
When I run the upgrade command it's throwing with
[Nest] 34073 - 06/12/2025, 9:32:03 PM ERROR [WorkspaceSyncMetadataService] Sync of standard objects failed with:
[Nest] 34073 - 06/12/2025, 9:32:03 PM ERROR [WorkspaceSyncMetadataService] Error: Join column for parent relation is present on both sides

11 Replies
Hello @Mauricio Natacci, I'm not sure to understand what you're trying to do
Couldn't you configure custom object data model using custom relation fields ?
Hello @prastoin how's it going?
I wanna add a relation between the same entity.
an abstract example:
Person...A person can be a father or a son, so to make this possible I need to relate the person to itself. how can I do this (relate an entity to itself)?
Hey @Mauricio Natacci ! good what about you ?
Unless I'm mistaken you should be able to find you way using the existing custom relation from the GUI !
Something like that

Pretty good! Thanks for asking!
Yup, but what about in the code? because if I add on the UI, it will only exist in that workspace, you know?! So I would like adding in the code to apply for any existing workspaces...
as you can see in the image, when I try to add directly in the code it's throwing (however, when I create on the UI, it works...but I need to make it work adding in the entity)
does that make more sense now @prastoin ?
How many workspaces are you working with ? nor how often to you need to re-create object model on the fly ?
I don't think this would be worth it for you to have a custom fork to statically add something that could be configured dynamically using a script hitting the API for all your workspaces object metadata on which you wanna have a relation to itself
I don't have a lot of workspaces right now but I would like in the future when my clients create workspaces, this field already exists
Ok ! Indeed sounds legitimate
FYI we should be introducing the very first Twenty as code configurations files for object metadata and high level architecture in September 2025
From there you have several possibilities:
- Create a script that will hit the API in order to create all your expected initial object metadata and fields
- Create them manually each time
- Modify the source code ( this means that ALL your object metadata models would have a self relation )
Great! Got it
Is there any difference/disadvantage in using a script to create something that doesn't exist in the entity?
I would say maintainability ! as modifiying the source code means having a custom build of twenty
Whereas this could be done through the API programmatically
I would opt for the most low cost tradeof
Got it! thanks a lot @prastoin 🙏
Yw ! Feel free to reach out with your script !
Have a great day