colossal-harlequinC
Apify & Crawlee12mo ago
9 replies
colossal-harlequin

Not able to use PPE in my actor

I have this in my .actor/pay_per_event.json and my calling this in my main.py. And i do get this warning in my terminal 2025-03-08T14:09:14.994Z [apify] WARN Ignored attempt to charge for an event - the Actor does not use the pay-per-event pricing
If i use await Actor.charge('actor-start-gb '), will be correctly using PPE. Please let me know. thank you in advance


{
    "actor-start": {
        "eventTitle": "Price for Actor start",
        "eventDescription": "Flat fee for starting an Actor run.",
        "eventPriceUsd": 0.1
    },
    "task-completed": {
        "eventTitle": "Price for completing the task",
        "eventDescription": "Flat fee for completing the task.",
        "eventPriceUsd": 0.4
    }
}


main.py

async def main():
    """Runs the AI Travel Planner workflow."""
    async with Actor:
        await Actor.charge('actor-start')

        actor_input = await Actor.get_input() or {}
        Actor.log.info(f"Received input: {actor_input}")

        travel_query = TravelState(**actor_input)

        # Execute workflow
        final_state = travel_workflow.invoke(travel_query)
        Actor.log.info(f"Workflow completed. Final state: {final_state}")
        await Actor.charge('task-completed')
        # Save the final report
        await save_report(final_state)
Was this page helpful?