fix(automations): support {{commentText}} placeholder replacement in ACTION_SET_VARIABLE

Open Beginner friendly
#63 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
1-3 hours
Newbie friendliness
88/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
nextjs, typescript
Domain
backend

Research direction

Read the ACTION_SET_VARIABLE branch in apps/api/src/instagram/services/instagram-automation-runner.service.ts and compare its replacements with the {{commentText}} quick insert in apps/web/app/dashboard/[companyId]/automation/components/FlowBuilder/node-config/nodes/SetVariableNodeConfig.tsx. Add the runtime replacement described in the issue, then check the relevant automation runner tests if available. Done means {{commentText}} resolves from context.messageText while the existing replacements still work.

Written by the indexing model from the issue text.

Description

backend good first issue
Problem Description

In apps/web/app/dashboard/[companyId]/automation/components/FlowBuilder/node-config/nodes/SetVariableNodeConfig.tsx (line 139), the Set Variable node UI provides a quick-insert chip for {{commentText}}.

However, in apps/api/src/instagram/services/instagram-automation-runner.service.ts (lines 948-955), ACTION_SET_VARIABLE only replaces {{messageText}} and {{username}}, leaving {{commentText}} unreplaced as a literal string.


Expected Behavior
  • Selecting {{commentText}} in SetVariableNodeConfig and saving a variable should resolve {{commentText}} to context.messageText at runtime, matching {{messageText}}.
  • Existing {{messageText}} and {{username}} replacements continue to work identically.

Where to Look
  • apps/api/src/instagram/services/instagram-automation-runner.service.ts (lines 948-955)
  • apps/web/app/dashboard/[companyId]/automation/components/FlowBuilder/node-config/nodes/SetVariableNodeConfig.tsx (line 139)

Solution / Implementation Guide
  1. In apps/api/src/instagram/services/instagram-automation-runner.service.ts inside the ACTION_SET_VARIABLE branch (around lines 949-954):
    • Replace {{commentText}} (in addition to {{messageText}}) with context.messageText ?? '' using a global replacement (replace(/\{\{commentText\}\}/g, context.messageText ?? '')).
Dominant language
TypeScript
Stars
2
Forks
1
Avg merge
6m
Merged PRs (30d)
27

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from sumamakhan761/tryinstance

All issues in sumamakhan761/tryinstance

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.