Flag a node using scheduler & Rule. But not getting the way how to achieve that.


  • I have a Content type "xxx" and I have set a flag with this content type.
  • So, whenever a user creates a content,I want to use scheduler so that user can specify at which particular date & time it should be flagged.

    (Scheduler provides when to publish and unpublish content,I want to Flag the content)

    Let me know if anyone having any idea about this.

Thanks in advance.

1 Answer 1


I know it was not that difficult but I was not getting the actual thing how to achieve it but now it is working for me.

Things to do:

  1. Go to your /admin/config/workflow/rules/components and click on "Add new Component"
  2. Select "Action set" under Component plugin & Press Continue.
  3. Give appropriate Name.E.g: Flag Node.

    Data type : Content, Label: Node, Machine name:node & Press Continue.

  4. Click on "Add action" & select "Flag a node" ,once it returns the result data,Select which flag should be clicked.

    For => node :Data selector use node &

    For =>User on whose behalf to flag : Data selector use node:author

    & Press Save.

    Done with the component.

    Now Add a New Rule

  5. Go to your /admin/config/workflow/rules and click on "Add new Rule"

  6. Give appropriate Name.E.g: Flag Node Rule.

    React on event : After updating existing content. (as you need)

    & Press Save

  7. You can add conditions if you want whether it should be published or should belong to any content type or what so ever you need. I have used Content is of type.

  8. This is the thing which works like a magic to schedule your event(Here Flag). Click on "Add action" & Select "Schedule component evaluation" under Rule Scheduler

    & Select the Component Value ** as (**Flag Node) which we created just before configuring this rule & Press Continue.

  9. Enter Scheduled evaluation date which will schedule your event when to get triggered.

    Data selector :(Enter Your values as +2 minutes, +2days, +2 weeks etc as your need)

  10. Identifier => Value : [node:title] has been Flagged.(You can use any message you want to see on /admin/config/workflow/rules/schedule along with list of scheduled events.)

  11. Node => Data selector : node

    & Press Save.

    Done with the Rule.

Configuration is done. You can test it now.

But please have a look into this. I was not checking such thing so was not able to see the result. Your event will respond you only after the cron run because it is executed by the cron. The cron triggers a query to check whether something should be published or flagged.If your cron runs every hour and you want something published on 22:35 and it is past that time it will be actually published the next time your cron runs. So if your cron runs at 22:30 and 23:30 the publish will be at 23:30.

Hope this will be helpful for someone.

Not the answer you're looking for? Browse other questions tagged or ask your own question.