PostHog Group

PostHog Group

Certified

Create or update a PostHog group

Creates a group, or updates the properties of an existing one, by sending a $groupidentify event. A group is an entity such as a company or an organization, identified by its type and its key. This does not make a user a member of the group: to attach events to a group, the events themselves must carry it. Group analytics is a paid PostHog feature, and a project can have at most 5 group types. Uses the project API key (phc_).

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

Create a company group and set its properties

yaml
id: define_company
namespace: company.growth

inputs:
  - id: user_id
    type: STRING
  - id: company_id
    type: STRING
  - id: company_name
    type: STRING

tasks:
  - id: define_company
    type: io.kestra.plugin.posthog.Group
    apiKey: "{{ secret('POSTHOG_API_KEY') }}"
    host: "https://us.i.posthog.com"
    distinctId: "{{ inputs.user_id }}"
    groupType: company
    groupKey: "{{ inputs.company_id }}"
    groupProperties:
      name: "{{ inputs.company_name }}"
      plan: enterprise
Properties

PostHog project API key

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

Distinct ID

The distinct ID of the user the group-identify event is sent for. PostHog does not use it to link the user to the group.

Group key

The unique identifier of the specific group within its type, e.g. a company ID.

Group type

The category of the group, e.g. company. Prefer a singular name.

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

Group properties

Optional properties to store on the group. Properties with a null value are omitted.

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.