Skip to content

Conversation

@kevinkim-ogp
Copy link
Contributor

@kevinkim-ogp kevinkim-ogp commented Nov 1, 2025

TL;DR

Adds a new GraphQL mutation generateAiSteps that allows users to create workflow steps using natural language descriptions.

  • Zod schemas for validating input, triggers, and actions
  • Integration with Langfuse (https://rome.pair.gov.sg) for prompt management and telemetry

The mutation accepts a trigger description and action descriptions in natural language, then returns structured workflow steps that can be used in the workflow builder.

How to test?

  • Call the generateAiSteps mutation and receive an object with the trigger and actions

Example

Input

mutation generateAiSteps($input: GenerateAiStepsInput!) {
  generateAiSteps(input: $input)
}
{
  "input": {
    "trigger": "When a new event attendance is received",
    "actions": "Find the attendee in Tiles\nIf the attendee is found, update the Attended? column to Yes\nIf the attendee is not found, create a new row in Tiles with the attendee's details."
  }
}

Output

{
  "data": {
    "generateAiSteps": {
      "trigger": {
        "position": 1,
        "type": "trigger",
        "appKey": "formsg",
        "key": "newSubmission",
        "description": "Triggers when a new event attendance form submission is received"
      },
      "actions": [
        {
          "description": "Find the attendee in Tiles database",
          "type": "action",
          "config": {
            "stepName": "Find Attendee",
            "templateConfig": {}
          },
          "position": 2,
          "appKey": "tiles",
          "key": "findSingleRow"
        },
        {
          "description": "Check if attendee was found in the database",
          "type": "action",
          "config": {
            "stepName": "If Attendee Found",
            "templateConfig": {}
          },
          "position": 3,
          "appKey": "toolbox",
          "key": "ifThen",
          "parameters": {
            "depth": 0,
            "branchName": "Attendee Found"
          }
        },
        {
          "description": "Update the Attended? column to Yes for existing attendee",
          "type": "action",
          "config": {
            "stepName": "Update Attendance Status",
            "templateConfig": {}
          },
          "position": 4,
          "appKey": "tiles",
          "key": "updateSingleRow"
        },
        {
          "description": "Check if attendee was not found in the database",
          "type": "action",
          "config": {
            "stepName": "If Attendee Not Found",
            "templateConfig": {}
          },
          "position": 5,
          "appKey": "toolbox",
          "key": "ifThen",
          "parameters": {
            "depth": 0,
            "branchName": "Attendee Not Found"
          }
        },
        {
          "description": "Create a new row in Tiles with the attendee's details and mark as attended",
          "type": "action",
          "config": {
            "stepName": "Create New Attendee Record",
            "templateConfig": {}
          },
          "position": 6,
          "appKey": "tiles",
          "key": "createTileRow"
        }
      ]
    }
  }
}

@kevinkim-ogp kevinkim-ogp changed the title feat: add input, trigger and action schemas [AI-3]: Mutation to generate AI steps Nov 1, 2025
@kevinkim-ogp kevinkim-ogp changed the base branch from ai-builder/bump-typescript to graphite-base/1302 November 1, 2025 05:38
@kevinkim-ogp kevinkim-ogp force-pushed the ai-builder/generate-steps-mutation branch from ba481e3 to 317f951 Compare November 1, 2025 06:35
@kevinkim-ogp kevinkim-ogp changed the base branch from graphite-base/1302 to ai-builder/bump-typescript November 1, 2025 06:35
@kevinkim-ogp kevinkim-ogp marked this pull request as ready for review November 3, 2025 07:46
@kevinkim-ogp kevinkim-ogp requested a review from a team as a code owner November 3, 2025 07:46
@kevinkim-ogp kevinkim-ogp force-pushed the ai-builder/bump-typescript branch from 2fa15b0 to cd478e9 Compare November 5, 2025 07:23
@kevinkim-ogp kevinkim-ogp force-pushed the ai-builder/generate-steps-mutation branch from 7049d69 to 13d363b Compare November 5, 2025 07:23
@kevinkim-ogp kevinkim-ogp changed the title [AI-3]: Mutation to generate AI steps [AI-3] PLU-583: Mutation to generate AI steps Nov 5, 2025
@linear
Copy link

linear bot commented Nov 5, 2025

@kevinkim-ogp kevinkim-ogp marked this pull request as draft November 27, 2025 01:27
@kevinkim-ogp kevinkim-ogp changed the title [AI-3] PLU-583: Mutation to generate AI steps [AI-3] PLU-583: (backend) mutation to generate AI steps Dec 4, 2025
@kevinkim-ogp kevinkim-ogp marked this pull request as ready for review December 9, 2025 01:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants