PostHog Alias

PostHog Alias

Certified

Create a PostHog alias

Tells PostHog that two identifiers belong to the same user, by sending a $create_alias event. The alias identity is merged into the distinctId identity: distinctId is the user that is kept, and both identifiers then resolve to that user. The merge is not applied by PostHog if the alias user has already been identified. Uses the project API key (phc_).

yaml
type: io.kestra.plugin.posthog.Alias

Link an anonymous ID to an authenticated user

yaml
id: link_anonymous_user
namespace: company.growth

inputs:
  - id: anonymous_id
    type: STRING
  - id: user_id
    type: STRING

tasks:
  - id: alias_user
    type: io.kestra.plugin.posthog.Alias
    apiKey: "{{ secret('POSTHOG_API_KEY') }}"
    host: "https://us.i.posthog.com"
    distinctId: "{{ inputs.user_id }}"
    alias: "{{ inputs.anonymous_id }}"
Properties

Alias

The other identity of the same user, e.g. an anonymous ID. It is merged into the user identified by distinctId. Must be different from distinctId.

PostHog project API key

The project API key (starts with phc_). Use a Kestra secret, e.g. {{ secret('POSTHOG_API_KEY') }}.

Distinct ID

The identity of the user that is kept, e.g. the authenticated user ID. The alias identity is merged into it.

Assets this task consumes as inputs or produces as outputs, for lineage tracking and the asset graph (Enterprise Edition). A flow declaring this property on a task is rejected in the open-source edition.

Definitions
assetFailureBehaviorstring
Possible Values
IGNOREFAILWARN

Asset failure behavior

Behavior applied to the task state when a declared asset fails to render, emit, or be persisted (e.g. a lock conflict): FAIL escalates it to FAILED, WARN (default) warns it if it would otherwise succeed, IGNORE leaves the state untouched.

enableAutobooleanstring

Whether to auto-register assets referenced dynamically at runtime that are not statically declared in inputs or outputs.

inputsarray

The assets consumed as inputs.

id*string
Min length1
typestring
outputs

The assets produced as outputs.

id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*string
Min length1

Custom asset type

descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150

PostHog host

The PostHog ingestion host, e.g. https://us.i.posthog.com (US Cloud), https://eu.i.posthog.com (EU Cloud) or a self-hosted URL. Defaults to US Cloud when empty.