How to use "variables" in config block

I have the following code

{{
    config(
        post_hook='{{ merge_insert("postgres.public.site", this, ["site_id", "display_name", "kind", "config", "disabled", "name", "instance_id", "created_at", "updated_at", "platform_object_id", "connection_id"], ["display_name", "name", "platform_object_id", "created_at", "updated_at"], ["connection_id", "platform_object_id"]) }}'    
    )
}}
select
    gen_random_uuid() as site_id,
    name as display_name,
    'CONNECTION'::sitekindenum as kind,
    '{}'::json as config,
    FALSE as disabled, 
    name as name,
    '{{ var("instance_id") }}'::uuid as instance_id,
    created_at,
    updated_at,
    id as platform_object_id,
    '{{ var("connection_id") }}'::uuid as connection_id
from
    {{ ref('stg_locations') }}

As we can see, the post-hook part is extremely long (calling a macro with several lists are arguments)
I am trying to break it down by assigning the list arguments to “variables” that are specific to models.

I tried to use {% set %}. But my understanding is that “local variables” in set is ignored during compiling time in config block.

What is the right way to do so?

Another questions, if these variables are execution time dependent, e.g., say one argument to the macro should be all columns in a table and can be obtained by calling [adaptors.get_columns_in_relation]( adapter | dbt Docs (getdbt.com)), how shall I make it available to the post-hook during compiling time?

hi there,
post and pre hooks except string values only. it doesn’t make use of variables.
it’s something i’d like to see happening in future, that these hooks are dynamic.
we’ve actually had to change the “standard” dbt code to handle this. not the hook code but the model code.

hope that makes sense.

Hi there,
Is there any update if this is now possible?