Skip to main content

Workflows API

Endpoints for workflow CRUD operations and execution.

Base URL

http://localhost:3001/workflow
Authentication Required

All workflow endpoints require authentication. Include the session cookie in requests.

Endpoints

Create Workflow

Creates a new workflow.

POST /workflow

Headers:

Content-Type: application/json
Cookie: connect.sid={session_cookie}

Request Body:

{
"name": "Meeting Follow-up Automation",
"actions": ["generate_mom", "send_email", "create_calendar"],
"actionConfigs": {
"send_email": {
"to": "team@company.com",
"subject": "Meeting Minutes"
}
},
"canvasData": {
"nodes": [
{
"id": "node-1",
"type": "trigger",
"position": { "x": 100, "y": 100 },
"data": { "label": "Manual Trigger" }
}
],
"edges": []
}
}
FieldTypeRequiredDescription
namestringYesWorkflow name
actionsstring[]YesArray of action types
actionConfigsobjectNoDefault configs for actions
canvasDataobjectNoReact Flow canvas state

Success Response (201):

{
"_id": "507f1f77bcf86cd799439011",
"userId": "507f1f77bcf86cd799439012",
"name": "Meeting Follow-up Automation",
"trigger": "manual",
"actions": ["generate_mom", "send_email", "create_calendar"],
"actionConfigs": {...},
"canvasData": {...},
"createdAt": "2024-12-26T10:00:00.000Z",
"updatedAt": "2024-12-26T10:00:00.000Z"
}

Error Response (400):

{
"error": "Name and actions are required"
}

Get All Workflows

Returns all workflows for the authenticated user.

GET /workflow

Success Response (200):

[
{
"_id": "507f1f77bcf86cd799439011",
"name": "Meeting Follow-up",
"trigger": "manual",
"actions": ["generate_mom", "send_email"],
"createdAt": "2024-12-26T10:00:00.000Z"
},
{
"_id": "507f1f77bcf86cd799439012",
"name": "Weekly Report",
"trigger": "manual",
"actions": ["generate_mom", "teams_post"],
"createdAt": "2024-12-25T09:00:00.000Z"
}
]

Get Single Workflow

Returns a specific workflow by ID.

GET /workflow/:id

URL Parameters:

ParameterTypeDescription
idstringWorkflow ID

Success Response (200):

{
"_id": "507f1f77bcf86cd799439011",
"userId": "507f1f77bcf86cd799439012",
"name": "Meeting Follow-up Automation",
"trigger": "manual",
"actions": ["generate_mom", "send_email", "create_calendar"],
"actionConfigs": {
"send_email": {
"to": "team@company.com"
}
},
"canvasData": {
"nodes": [...],
"edges": [...]
},
"createdAt": "2024-12-26T10:00:00.000Z",
"updatedAt": "2024-12-26T10:00:00.000Z"
}

Error Response (404):

{
"error": "Workflow not found"
}

Execute Workflow

Executes a workflow with provided data.

POST /workflow/run/:id

URL Parameters:

ParameterTypeDescription
idstringWorkflow ID

Request Body:

{
"momContent": "Meeting notes to process...",
"emailTo": "recipient@example.com",
"emailSubject": "Meeting Minutes",
"emailBody": "Optional custom body",
"calendarTitle": "Follow-up Meeting",
"calendarStart": "2024-12-27T14:00:00",
"calendarEnd": "2024-12-27T15:00:00",
"calendarAttendees": ["john@example.com", "sarah@example.com"],
"teamsTeamId": "team-id",
"teamsChannelId": "channel-id",
"teamsMessage": "Optional custom message"
}
FieldTypeRequiredDescription
momContentstringFor MOM actionMeeting notes
emailTostringFor email actionRecipient email(s)
emailSubjectstringFor email actionEmail subject
emailBodystringNoCustom email body
calendarTitlestringFor calendarEvent title
calendarStartstringFor calendarISO 8601 datetime
calendarEndstringFor calendarISO 8601 datetime
calendarAttendeesstring[]NoAttendee emails
teamsTeamIdstringFor TeamsTeam ID
teamsChannelIdstringFor TeamsChannel ID
teamsMessagestringNoCustom message

Success Response (200):

{
"success": true,
"logId": "507f1f77bcf86cd799439013",
"actionsExecuted": ["generate_mom", "send_email", "create_calendar"]
}

Partial Success Response (200):

{
"success": false,
"logId": "507f1f77bcf86cd799439013",
"actionsExecuted": ["generate_mom"],
"error": "Missing required permissions: Mail.Send"
}

Error Response (404):

{
"error": "Workflow not found"
}

Delete Workflow

Deletes a workflow.

DELETE /workflow/:id

URL Parameters:

ParameterTypeDescription
idstringWorkflow ID

Success Response (200):

{
"success": true
}

Error Response (404):

{
"error": "Workflow not found"
}

Action Types

Available actions for workflows:

ActionDescriptionRequired Fields
generate_momGenerate meeting minutesmomContent
send_emailSend Outlook emailemailTo, emailSubject
create_calendarCreate calendar eventcalendarTitle, calendarStart, calendarEnd
teams_postPost to Teams channelteamsTeamId, teamsChannelId
create_pptCreate PowerPoint(Coming soon)
ai_processCustom AI processing(Coming soon)
save_dataSave data(Coming soon)
api_callExternal API call(Coming soon)

Error Codes

CodeDescription
400Bad request (validation failed)
401Not authenticated
404Workflow not found
500Server error