Elements runtime reference / Side effects

createNotification

Append a notification side effect to Element runtime output.

Signatuur

createNotification(payload=None, **kwargs)

Doel

Append a notification side effect to Element runtime output.

Aliases and imports

  • create_notification
  • yieldNotification
  • yield_notification
  • notify

Payloadformaat

Use these fields as the Python call arguments or keyword payload for this helper.

{
  "title": "Issue escalated",
  "body": "Review required",
  "recipientUids": [
    "user-123"
  ],
  "data": [
    {
      "id": "sample",
      "widget": "table",
      "data": [
        {
          "key": "value"
        }
      ]
    }
  ]
}
FieldDescription
payloadOptional notification dict.
title/body/descriptionNotification display fields.
userUid/userIds/recipientUidsRecipient uid fields.
dataOptional datasets such as table payloads with id, title, widget, columns, and data rows.

Return payload

{
  "title": "Issue escalated",
  "body": "Review required",
  "recipientUids": [
    "user-123"
  ],
  "data": [
    {
      "id": "sample",
      "widget": "table",
      "data": [
        {
          "key": "value"
        }
      ]
    }
  ]
}

Voorbeeld

def run():
    createNotification(
        title="Issue escalated",
        body="Review required",
        data=[{"id": "sample", "widget": "table", "data": [{"key": "value"}]}],
    )
    return {"notified": True}

Scope-notities