Record Event Node in Pathways

From FojiSoft Docs
Revision as of 23:02, 5 March 2025 by Mitchell.Hirsche (talk | contribs) (Mitchell.Hirsche moved page Documentation for the "Record Event" Node in Pathways to Record Event Node in Pathways)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

The Record Event node in Pathways allows workflows to log custom events into an event log. These events can include additional metadata, descriptions, URLs, and labels to provide context and enhance traceability. This node is versatile, enabling workflows to document key actions or occurrences dynamically.


Node Properties

1. Name

  • Description: A unique identifier for the node in the workflow.
  • Usage: Provide a clear, descriptive name that reflects the purpose of the event being recorded.
  • Example: "Log Claim Submission Event"

2. Event Name

  • Description: The name of the event being recorded.
  • Usage: Use a concise and meaningful name for the event, as this will appear in the event log.
  • Example: "Claim Submission"

3. Event Severity

  • Description: Indicates the severity level of the event. Typically ranges from 0 (low severity) to 100 (critical severity).
  • Usage: Assign an appropriate severity value to classify the event's importance.
  • Example: 50 (Moderate severity for a non-critical operation).

Data, Description, and URL

4. Data

  • Type: None, Defined
  • Description: Captures additional data to log with the event.
  • Options:
    1. None: No data will be logged with the event.
    2. Defined: Allows the user to define data dynamically using a Script or Handlebars Template.

Example (Script):

return {"claim_id": claim_id, "status": status}

Example (Handlebars Template):

CopyEdit

{{ClaimID}} - {{Status}}

5. Description

  • Type: None, Defined
  • Description: Provides a human-readable description of the event.
  • Options:
    1. None: No description will be logged.
    2. Defined: Allows for dynamic description generation using a Script or Handlebars Template.

Example (Script):

return f"Claim {claim_id} was submitted successfully."

Example (Handlebars Template):

Claim {{ClaimID}} was submitted successfully.

6. URL

  • Type: None, Defined
  • Description: Specifies a URL to associate with the event, such as a link to related documentation or further details.
  • Options:
    1. None: No URL will be associated with the event.
    2. Defined: Allows for dynamic URL generation using a Script or Handlebars Template.

Example (Script):

return f"https://example.com/claims/{claim_id}"

Example (Handlebars Template):

https://example.com/claims/{{ClaimID}}


Labels

7. Labels

  • Description: Adds tags or labels to the event for categorization and filtering.
  • Usage: Use meaningful names and dynamic values to create labels for the event.
  • Options:
    • Name: The name of the label.
    • Expression: The value of the label, defined dynamically using a Script or Handlebars Template.

Example (Script):

return {"priority": "high", "type": "submission"}

Example (Handlebars Template):

{{Priority}} - {{Type}}


How It Works

  1. Define Event:
    • Set the event name, severity, and optional metadata (data, description, URL, and labels).
  2. Add Metadata:
    • Use dynamic values through scripts or templates to add data, a description, or a URL.
  3. Log Event:
    • When the workflow reaches this node, the event is recorded in the event log with all configured properties.

Use Case Examples

1. Log Claim Submission

  • Name: Log Claim Submission
  • Event Name: Claim Submission
  • Event Severity: 50
  • Data:
    • Type: Defined

Expression (Script):

return {"claim_id": claim_id, "status": status}

  • Description:
    • Type: Defined

Expression (Handlebars):

Claim {{ClaimID}} submitted with status {{Status}}.

  • Outcome: Logs a submission event with relevant metadata for traceability.

2. Record Invoice Status Update

  • Name: Log Invoice Update
  • Event Name: Invoice Status Change
  • Event Severity: 70
  • Labels:
    • Name: Priority
    • Expression: {{Priority}}
  • Description:
    • Type: Defined

Expression (Script):

return f"Invoice {invoice_id} status updated to {status}."

  • Outcome: Captures the update of an invoice status in the event log.

Best Practices

  1. Use Meaningful Names:
    • Clearly name events to make logs easy to interpret.
  2. Classify Events:
    • Assign severity values appropriately to reflect the importance of the event.
  3. Dynamic Metadata:
    • Leverage scripts and templates to add detailed, contextual metadata to events.
  4. Categorize with Labels:
    • Use labels to group and filter events for easier analysis.

The Record Event node is a powerful tool for enhancing workflow traceability and capturing critical events. Its flexibility in logging metadata, descriptions, and labels makes it a valuable addition to any automated process.